summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-15 21:00:56 +0200
committerCedric BAIL <cedric.bail@free.fr>2019-07-17 10:17:44 -0700
commite76349cd41d92b5fcf189d21a79c8d40dfeb9604 (patch)
tree93638049015d493e257ec89b180d789c8b7665f7
parentf62d0dc36b6ba46d544aa9103036dfac60bd200c (diff)
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
-rw-r--r--src/lib/elementary/efl_ui_widget.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 2ed0f9b379..a8d8987a6e 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -490,6 +490,10 @@ _logical_parent_eval(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd, Eina_Bool s
490 { 490 {
491 ELM_WIDGET_DATA_GET_OR_RETURN(pd->logical.parent, logical_wd, NULL); 491 ELM_WIDGET_DATA_GET_OR_RETURN(pd->logical.parent, logical_wd, NULL);
492 logical_wd->logical.child_count --; 492 logical_wd->logical.child_count --;
493 if (logical_wd->logical.child_count == 0)
494 {
495 *state_change_to_parent = EINA_TRUE;
496 }
493 } 497 }
494 old = pd->logical.parent; 498 old = pd->logical.parent;
495 efl_weak_unref(&pd->logical.parent); 499 efl_weak_unref(&pd->logical.parent);
@@ -525,19 +529,23 @@ _full_eval(Eo *obj, Elm_Widget_Smart_Data *pd)
525 529
526 old_parent = _logical_parent_eval(obj, pd, should, &state_change_to_parent); 530 old_parent = _logical_parent_eval(obj, pd, should, &state_change_to_parent);
527 531
528 if (efl_isa(old_parent, EFL_UI_WIDGET_CLASS)) 532 if (state_change_to_parent)
529 { 533 {
530 //emit signal and focus eval old and new 534 if (efl_isa(old_parent, EFL_UI_WIDGET_CLASS))
531 ELM_WIDGET_DATA_GET(old_parent, old_pd); 535 {
532 _full_eval(old_parent, old_pd); 536 //emit signal and focus eval old and new
533 } 537 ELM_WIDGET_DATA_GET(old_parent, old_pd);
538 _full_eval(old_parent, old_pd);
539 }
534 540
535 if (state_change_to_parent && efl_isa(pd->logical.parent, EFL_UI_WIDGET_CLASS)) 541 if (efl_isa(pd->logical.parent, EFL_UI_WIDGET_CLASS))
536 { 542 {
537 ELM_WIDGET_DATA_GET(pd->logical.parent, new_pd); 543 ELM_WIDGET_DATA_GET(pd->logical.parent, new_pd);
538 _full_eval(pd->logical.parent, new_pd); 544 _full_eval(pd->logical.parent, new_pd);
545 }
539 } 546 }
540 547
548
541 _focus_manager_eval(obj, pd, want_full, should); 549 _focus_manager_eval(obj, pd, want_full, should);
542 550
543 old_registered_parent = pd->focus.parent; 551 old_registered_parent = pd->focus.parent;