summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_callbacks.c
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2019-01-24 11:34:12 -0600
committerDerek Foreman <derek.foreman.samsung@gmail.com>2019-01-25 13:00:43 -0600
commit41a9e1c8737c5167c7974c0f51aa1a531aad4b62 (patch)
treebcc7bdd3120809395c01993c65915e3fd5d472a8 /src/lib/evas/canvas/evas_callbacks.c
parent955c4bd4a0bf4d2167b4d3377ecdf97cd6401740 (diff)
gesture_manager: Use private data getter to save some lookups
We frequently process an array of several events at once, so we can now look up the gesture manager private data once for the entire array. Differential Revision: https://phab.enlightenment.org/D7763 Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index 6db38e81f4..37e62976ff 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -792,12 +792,17 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
792 const Efl_Callback_Array_Item_Full *array = event->info; 792 const Efl_Callback_Array_Item_Full *array = event->info;
793 Evas_Object_Protected_Data *obj = data; 793 Evas_Object_Protected_Data *obj = data;
794 Evas_Callback_Type type = EVAS_CALLBACK_LAST; 794 Evas_Callback_Type type = EVAS_CALLBACK_LAST;
795 void *gd = NULL;
795 int i; 796 int i;
796 797
797 for (i = 0; array[i].desc != NULL; i++) 798 for (i = 0; array[i].desc != NULL; i++)
798 { 799 {
799 if (obj->layer->evas->gesture_manager) 800 if (obj->layer->evas->gesture_manager)
800 _efl_canvas_gesture_manager_callback_add_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc); 801 {
802 if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager);
803
804 _efl_canvas_gesture_manager_callback_add_hook(gd, obj->object, array[i].desc);
805 }
801 806
802 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) 807 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
803 { 808 {
@@ -819,6 +824,7 @@ _check_event_catcher_del(void *data, const Efl_Event *event)
819{ 824{
820 const Efl_Callback_Array_Item_Full *array = event->info; 825 const Efl_Callback_Array_Item_Full *array = event->info;
821 Evas_Object_Protected_Data *obj = data; 826 Evas_Object_Protected_Data *obj = data;
827 void *gd = NULL;
822 int i; 828 int i;
823 829
824 if (!obj->layer || 830 if (!obj->layer ||
@@ -828,7 +834,11 @@ _check_event_catcher_del(void *data, const Efl_Event *event)
828 for (i = 0; array[i].desc != NULL; i++) 834 for (i = 0; array[i].desc != NULL; i++)
829 { 835 {
830 if (obj->layer->evas->gesture_manager) 836 if (obj->layer->evas->gesture_manager)
831 _efl_canvas_gesture_manager_callback_del_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc); 837 {
838 if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager);
839
840 _efl_canvas_gesture_manager_callback_del_hook(gd, obj->object, array[i].desc);
841 }
832 842
833 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) 843 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
834 { 844 {