forked from enlightenment/efl
evas: don't emit EVAS_CALLBACK_MOVE event if nobody is listening.
This give a constant improvement of 2% over a total benchmark run while scrolling genlist. This benchmark included setup and destruction of the scene, so under estimate the cost of the callback emit.
This commit is contained in:
parent
1ec244a09e
commit
bdd163fce8
|
@ -201,6 +201,11 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
|
|||
if (!(e = obj->layer->evas)) return;
|
||||
|
||||
_evas_walk(e);
|
||||
|
||||
if (type == EVAS_CALLBACK_MOVE &&
|
||||
obj->move_ref == 0)
|
||||
goto nothing_here;
|
||||
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
|
@ -248,6 +253,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
|
|||
}
|
||||
}
|
||||
|
||||
nothing_here:
|
||||
if (!obj->no_propagate)
|
||||
{
|
||||
if ((obj->smart.parent) && (type != EVAS_CALLBACK_FREE) &&
|
||||
|
|
|
@ -117,10 +117,10 @@ _check_event_catcher_add(void *data,
|
|||
eo_event_callback_add(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _animator_repeater, obj));
|
||||
INF("Registering an animator tick on canvas %p for object %p.",
|
||||
obj->layer->evas->evas, obj->object);
|
||||
|
||||
// No need to walk more than once per array as you can not del
|
||||
// a partial array
|
||||
break;
|
||||
}
|
||||
else if (array[i].desc == EVAS_OBJECT_EVENT_MOVE)
|
||||
{
|
||||
obj->move_ref++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,8 +147,10 @@ _check_event_catcher_del(void *data,
|
|||
eo_event_callback_del(EFL_CORE_ANIMATOR_EVENT_ANIMATOR_TICK, _animator_repeater, obj));
|
||||
INF("Unregistering an animator tick on canvas %p for object %p.",
|
||||
obj->layer->evas->evas, obj->object);
|
||||
|
||||
break;
|
||||
}
|
||||
else if (array[i].desc == EVAS_OBJECT_EVENT_MOVE)
|
||||
{
|
||||
obj->move_ref--;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1073,6 +1073,7 @@ struct _Evas_Object_Protected_Data
|
|||
unsigned int ref;
|
||||
|
||||
unsigned int animator_ref;
|
||||
unsigned int move_ref;
|
||||
|
||||
unsigned char delete_me;
|
||||
|
||||
|
|
Loading…
Reference in New Issue