summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-14 09:29:50 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-14 09:29:50 -0400
commitb1a2d82417e5c1bbd89835c63b84c500e313df5b (patch)
treef7a99cbf2012d5645952ffd14582af936e3f362e
parentf174bf2eb23c4353f907e991ab871b5f191de48e (diff)
edje: block "recalc" event emission if it isn't being subscribed to
Summary: this gets called a ton ref T8321 Depends on D10356 Reviewers: bu5hm4n, cedric Reviewed By: bu5hm4n, cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8321 Differential Revision: https://phab.enlightenment.org/D10357
-rw-r--r--src/lib/edje/edje_calc.c2
-rw-r--r--src/lib/edje/edje_private.h1
-rw-r--r--src/lib/edje/edje_smart.c24
3 files changed, 26 insertions, 1 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 174033c..091a27e 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -1043,7 +1043,7 @@ _edje_recalc_do(Edje *ed)
1043#endif 1043#endif
1044 if (!ed->calc_only) 1044 if (!ed->calc_only)
1045 { 1045 {
1046 if (ed->recalc_call) 1046 if (ed->recalc_call && ed->has_recalc_event_cb)
1047 efl_event_callback_legacy_call(ed->obj, EFL_LAYOUT_EVENT_RECALC, NULL); 1047 efl_event_callback_legacy_call(ed->obj, EFL_LAYOUT_EVENT_RECALC, NULL);
1048 } 1048 }
1049 else 1049 else
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index eeee348..6893dd3 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -1802,6 +1802,7 @@ struct _Edje
1802 Eina_Bool need_map_update : 1; 1802 Eina_Bool need_map_update : 1;
1803 Eina_Bool canvas_animator : 1; 1803 Eina_Bool canvas_animator : 1;
1804 Eina_Bool has_state_clip : 1; 1804 Eina_Bool has_state_clip : 1;
1805 Eina_Bool has_recalc_event_cb : 1;
1805}; 1806};
1806 1807
1807struct _Edje_Calc_Params_Map 1808struct _Edje_Calc_Params_Map
diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c
index de2575c..ff023f8 100644
--- a/src/lib/edje/edje_smart.c
+++ b/src/lib/edje/edje_smart.c
@@ -601,9 +601,33 @@ _efl_canvas_layout_efl_player_playback_speed_get(const Eo *obj EINA_UNUSED, Edje
601} 601}
602 602
603/* Internal EO APIs and hidden overrides */ 603/* Internal EO APIs and hidden overrides */
604EOLIAN static Eina_Bool
605_efl_canvas_layout_efl_object_event_callback_priority_add(Eo *obj, Edje *pd, const Efl_Event_Description *desc, Efl_Callback_Priority priority, Efl_Event_Cb func, const void *user_data)
606{
607 if (desc == EFL_LAYOUT_EVENT_RECALC)
608 {
609 pd->has_recalc_event_cb = EINA_TRUE;
610 }
611
612 return efl_event_callback_priority_add(efl_super(obj, MY_CLASS), desc, priority, func, user_data);
613}
604 614
615EOLIAN static Eina_Bool
616_efl_canvas_layout_efl_object_event_callback_array_priority_add(Eo *obj, Edje *pd, const Efl_Callback_Array_Item *array, Efl_Callback_Priority priority, const void *user_data)
617{
618 for (int i = 0; array[i].desc; ++i)
619 {
620 if (array[i].desc == EFL_LAYOUT_EVENT_RECALC)
621 {
622 pd->has_recalc_event_cb = EINA_TRUE;
623 }
624 }
625 return efl_event_callback_array_priority_add(efl_super(obj, MY_CLASS), array, priority, user_data);
626}
605#define EFL_CANVAS_LAYOUT_EXTRA_OPS \ 627#define EFL_CANVAS_LAYOUT_EXTRA_OPS \
606 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_canvas_layout), \ 628 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_canvas_layout), \
629 EFL_OBJECT_OP_FUNC(efl_event_callback_priority_add, _efl_canvas_layout_efl_object_event_callback_priority_add), \
630 EFL_OBJECT_OP_FUNC(efl_event_callback_array_priority_add, _efl_canvas_layout_efl_object_event_callback_array_priority_add), \
607 EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_layout_efl_object_dbg_info_get) 631 EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_layout_efl_object_dbg_info_get)
608 632
609#include "efl_canvas_layout.eo.c" 633#include "efl_canvas_layout.eo.c"