efl_ui_widget: performance optimize deletion

when a logic parent does not have any widgets left, the parent needs to
be reevaluated. However, this only has to happen when there is a change
in state (eg. from 0 -> N or from N -> 0). Every other call can be
safed. This commit introduces this checking, and safes up performance.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9323
This commit is contained in:
Marcel Hollerbach 2019-07-15 21:00:56 +02:00 committed by Cedric BAIL
parent f62d0dc36b
commit e76349cd41
1 changed files with 17 additions and 9 deletions

View File

@ -490,6 +490,10 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool s
{
ELM_WIDGET_DATA_GET_OR_RETURN(pd->logical.parent, logical_wd, NULL);
logical_wd->logical.child_count --;
if (logical_wd->logical.child_count == 0)
{
*state_change_to_parent = EINA_TRUE;
}
}
old = pd->logical.parent;
efl_weak_unref(&pd->logical.parent);
@ -525,18 +529,22 @@ _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
old_parent = _logical_parent_eval(obj, pd, should, &state_change_to_parent);
if (efl_isa(old_parent, EFL_UI_WIDGET_CLASS))
if (state_change_to_parent)
{
//emit signal and focus eval old and new
ELM_WIDGET_DATA_GET(old_parent, old_pd);
_full_eval(old_parent, old_pd);
if (efl_isa(old_parent, EFL_UI_WIDGET_CLASS))
{
//emit signal and focus eval old and new
ELM_WIDGET_DATA_GET(old_parent, old_pd);
_full_eval(old_parent, old_pd);
}
if (efl_isa(pd->logical.parent, EFL_UI_WIDGET_CLASS))
{
ELM_WIDGET_DATA_GET(pd->logical.parent, new_pd);
_full_eval(pd->logical.parent, new_pd);
}
}
if (state_change_to_parent && efl_isa(pd->logical.parent, EFL_UI_WIDGET_CLASS))
{
ELM_WIDGET_DATA_GET(pd->logical.parent, new_pd);
_full_eval(pd->logical.parent, new_pd);
}
_focus_manager_eval(obj, pd, want_full, should);