summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-22 15:50:04 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-26 11:37:04 +0100
commitacee09f5851903a7e16e1507766718ea22a266c8 (patch)
tree78c1d0a02e6b3dc2b48961c815e1c4a0aa4a4680 /src/lib/elementary
parenta73904ba66226c2b4cdcd606e04c58e4ed2539c1 (diff)
efl_ui_focus_manager_sub: freeze manager when parent manager is frozen
a efl_ui_focus_manager_sub object is a manager object by itself. It registeres the border elements of itself in the parent focus manager. However, all elements that are registered in this manager object, are also automatically children of the parent root object, which means, when the root object of the parent manager object is moved, then those children will also be moved. Which means, when the parent manager can ignore those changes, we can also ignore them. This improves the overall performance of the "Scroller 2" test case by 26%. The change to the test is required in order to redirect the events so the self_dirty bit is setted correctly Differential Revision: https://phab.enlightenment.org/D7350
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_focus_manager_sub.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c
index 57997afd41..90ac4f7387 100644
--- a/src/lib/elementary/efl_ui_focus_manager_sub.c
+++ b/src/lib/elementary/efl_ui_focus_manager_sub.c
@@ -84,6 +84,7 @@ _border_flush(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd)
84 84
85 eina_list_free(pd->current_border); 85 eina_list_free(pd->current_border);
86 pd->current_border = selection; 86 pd->current_border = selection;
87 pd->self_dirty = EINA_FALSE;
87} 88}
88 89
89static void 90static void
@@ -105,7 +106,7 @@ _parent_manager_pre_flush(void *data, const Efl_Event *ev EINA_UNUSED)
105{ 106{
106 MY_DATA(data, pd); 107 MY_DATA(data, pd);
107 108
108 //if (!pd->self_dirty) return; //we are not interested 109 if (!pd->self_dirty) return; //we are not interested
109 110
110 _border_flush(data, pd); 111 _border_flush(data, pd);
111} 112}
@@ -116,12 +117,27 @@ _redirect_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
116 //if (efl_ui_focus_manager_redirect_get(ev->object) != data) return; 117 //if (efl_ui_focus_manager_redirect_get(ev->object) != data) return;
117 118
118 MY_DATA(data, pd); 119 MY_DATA(data, pd);
120
119 _border_flush(data, pd); 121 _border_flush(data, pd);
120} 122}
121 123
124static void
125_freeze_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED)
126{
127 if (ev->info)
128 {
129 efl_ui_focus_manager_dirty_logic_freeze(data);
130 }
131 else
132 {
133 efl_ui_focus_manager_dirty_logic_unfreeze(data);
134 }
135}
136
122EFL_CALLBACKS_ARRAY_DEFINE(parent_manager, 137EFL_CALLBACKS_ARRAY_DEFINE(parent_manager,
123 {EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, _parent_manager_pre_flush}, 138 {EFL_UI_FOCUS_MANAGER_EVENT_FLUSH_PRE, _parent_manager_pre_flush},
124 {EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, _redirect_changed_cb} 139 {EFL_UI_FOCUS_MANAGER_EVENT_REDIRECT_CHANGED, _redirect_changed_cb},
140 {EFL_UI_FOCUS_MANAGER_EVENT_DIRTY_LOGIC_FREEZE_CHANGED, _freeze_changed_cb}
125); 141);
126 142
127static void 143static void
@@ -198,6 +214,9 @@ _efl_ui_focus_manager_sub_efl_object_constructor(Eo *obj, Efl_Ui_Focus_Manager_S
198{ 214{
199 obj = efl_constructor(efl_super(obj, MY_CLASS)); 215 obj = efl_constructor(efl_super(obj, MY_CLASS));
200 efl_event_callback_array_add(obj, self_manager(), obj); 216 efl_event_callback_array_add(obj, self_manager(), obj);
217
218 pd->self_dirty = EINA_TRUE;
219
201 return obj; 220 return obj;
202} 221}
203 222