diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-08-10 15:25:44 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-08-10 15:26:05 +0900 |
commit | 8cb3b79a82b1769cba5a7a10f9937aa18dd65d8a (patch) | |
tree | e2e771a4bbd8f2167042661a4c63d886afea7fb8 | |
parent | 58aa349283d19e58eadb1acb7596d6ca1f23ea8d (diff) | |
download | efl-8cb3b79a82b1769cba5a7a10f9937aa18dd65d8a.tar.gz |
evas: Optimize out a function call if not required
Same as the previous patch in elm_widget: don't call
flags_set() if the flags have not changed.
-rw-r--r-- | src/lib/evas/canvas/evas_callbacks.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c index 00a5e6270c..cdd8fc8cea 100644 --- a/src/lib/evas/canvas/evas_callbacks.c +++ b/src/lib/evas/canvas/evas_callbacks.c @@ -265,7 +265,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data /* new input events */ if (eo_event_desc) { - Efl_Event_Flags *pevflags = NULL; + Efl_Event_Flags *pevflags = NULL, evflags; #define EV_CASE(TYPE, NEWTYPE, Type) \ case EVAS_CALLBACK_ ## TYPE: \ @@ -288,9 +288,14 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data } #undef EV_CASE - if (pevflags) efl_event_flags_set(eo_event_info, *pevflags); + if (pevflags) + { + efl_event_flags_set(eo_event_info, *pevflags); + evflags = *pevflags; + } eo_event_callback_call(eo_obj, eo_event_desc, eo_event_info); - if (pevflags) *pevflags = efl_event_flags_get(eo_event_info); + if (pevflags && (*pevflags != evflags)) + *pevflags = efl_event_flags_get(eo_event_info); } /* legacy callbacks - relying on Efl.Canvas.Object events */ |