From f8193c22fa299e2eacdca44fe660545ceaa67c47 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Thu, 22 Oct 2020 18:01:47 +0900 Subject: [PATCH] subsurface: Remove some unnecessary internal API for sub-surface. If stacking order of sub-surfaces changes, there is no choice but to update stacking order of composite objects associated with sub-surfaces. So stacking order of composite objects can be updated when order is applied. By doing this, internal API for re-stacking composite objects and below_obj can be removed. Change-Id: I26a305078ad2fd708e7dcba0ef154077a7829876 --- src/bin/e_comp_wl.c | 6 +---- src/bin/e_comp_wl_subsurface.c | 45 +++++++++++++++------------------- src/bin/e_comp_wl_subsurface.h | 2 -- 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index e04d06c880..c9e5a29571 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -4355,11 +4355,7 @@ e_comp_wl_surface_commit(E_Client *ec) ignored = ec->ignored; - if (e_comp_wl_subsurface_order_commit(ec)) - { - e_comp_wl_subsurface_restack(ec); - e_comp_wl_subsurface_restack_bg_rectangle(ec); - } + e_comp_wl_subsurface_order_commit(ec); if (!e_pixmap_usable_get(ec->pixmap)) { diff --git a/src/bin/e_comp_wl_subsurface.c b/src/bin/e_comp_wl_subsurface.c index 688cc551e7..307ba2e5ca 100644 --- a/src/bin/e_comp_wl_subsurface.c +++ b/src/bin/e_comp_wl_subsurface.c @@ -326,7 +326,7 @@ _e_comp_wl_subsurface_invisible_parent_get(E_Client *ec) } static Eina_Bool -_e_comp_wl_subsurface_order_commit(E_Client *ec) +_e_comp_wl_subsurface_order_commit_recursive(E_Client *ec) { E_Client *subc; Eina_List *l; @@ -344,7 +344,7 @@ _e_comp_wl_subsurface_order_commit(E_Client *ec) ec->comp_data->sub.list = eina_list_remove(ec->comp_data->sub.list, subc); ec->comp_data->sub.list = eina_list_append(ec->comp_data->sub.list, subc); - _e_comp_wl_subsurface_order_commit(subc); + _e_comp_wl_subsurface_order_commit_recursive(subc); } EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc) @@ -352,12 +352,25 @@ _e_comp_wl_subsurface_order_commit(E_Client *ec) ec->comp_data->sub.below_list = eina_list_remove(ec->comp_data->sub.below_list, subc); ec->comp_data->sub.below_list = eina_list_append(ec->comp_data->sub.below_list, subc); - _e_comp_wl_subsurface_order_commit(subc); + _e_comp_wl_subsurface_order_commit_recursive(subc); } return EINA_TRUE; } +static void +_e_comp_wl_subsurface_order_commit(E_Client *ec) +{ + Eina_Bool res; + + res = _e_comp_wl_subsurface_order_commit_recursive(ec); + if (res) + { + _e_comp_wl_subsurface_restack(ec); + _e_comp_wl_subsurface_restack_bg_rectangle(ec); + } +} + static void _e_comp_wl_subsurface_commit_to_cache(E_Client *ec) { @@ -461,11 +474,7 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec) e_comp_wl_buffer_reference(&sdata->cached_buffer_ref, NULL); - if (_e_comp_wl_subsurface_order_commit(ec)) - { - _e_comp_wl_subsurface_restack(ec); - _e_comp_wl_subsurface_restack_bg_rectangle(ec); - } + _e_comp_wl_subsurface_order_commit(ec); sdata->cached.has_data = EINA_FALSE; } @@ -1110,7 +1119,9 @@ e_comp_wl_subsurface_order_commit(E_Client *ec) { EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - return _e_comp_wl_subsurface_order_commit(ec); + _e_comp_wl_subsurface_order_commit(ec); + + return EINA_FALSE; } EINTERN Eina_Bool @@ -1208,22 +1219,6 @@ e_comp_wl_subsurface_hide(E_Client *ec) _e_comp_wl_subsurface_hide(ec); } -EINTERN void -e_comp_wl_subsurface_restack_bg_rectangle(E_Client *ec) -{ - EINA_SAFETY_ON_NULL_RETURN(ec); - - _e_comp_wl_subsurface_restack_bg_rectangle(ec); -} - -EINTERN void -e_comp_wl_subsurface_restack(E_Client *ec) -{ - EINA_SAFETY_ON_NULL_RETURN(ec); - - _e_comp_wl_subsurface_restack(ec); -} - E_API void e_comp_wl_subsurface_stack_update(E_Client *ec) { diff --git a/src/bin/e_comp_wl_subsurface.h b/src/bin/e_comp_wl_subsurface.h index d137c44408..085144b3e1 100644 --- a/src/bin/e_comp_wl_subsurface.h +++ b/src/bin/e_comp_wl_subsurface.h @@ -19,8 +19,6 @@ EINTERN Eina_Bool e_comp_wl_subsurface_commit(E_Client *ec); EINTERN Eina_Bool e_comp_wl_subsurface_can_show(E_Client *ec); EINTERN void e_comp_wl_subsurface_show(E_Client *ec); EINTERN void e_comp_wl_subsurface_hide(E_Client *ec); -EINTERN void e_comp_wl_subsurface_restack_bg_rectangle(E_Client *ec); -EINTERN void e_comp_wl_subsurface_restack(E_Client *ec); EINTERN Eina_Bool e_comp_wl_video_subsurface_has(E_Client *ec); EINTERN Eina_Bool e_comp_wl_normal_subsurface_has(E_Client *ec); EINTERN void e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec); -- 2.34.1