From 92249df1427106b6ac0789ca5924e83269ae9d8f Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Thu, 23 Jul 2020 15:41:24 +0900 Subject: [PATCH] subsurface: cleanup for the below_obj of topmost. do not call recursivley for the clarification. since this function is obviously for topmost surface, there is no need to use recursive call. no functional changes Change-Id: Ibc34b7c324d344b5433220deda7cdae0b0b9da8b --- src/bin/e_comp_wl_subsurface.c | 52 ++++++++++++++-------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/src/bin/e_comp_wl_subsurface.c b/src/bin/e_comp_wl_subsurface.c index 102d521e85..dab627873f 100644 --- a/src/bin/e_comp_wl_subsurface.c +++ b/src/bin/e_comp_wl_subsurface.c @@ -175,45 +175,37 @@ _e_comp_wl_subsurface_check_below_bg_rectangle(E_Client *ec) { E_Client *topmost; - if (_e_comp_wl_subsurface_data_get(ec)) - { - topmost = e_comp_wl_topmost_parent_get(ec); - if (!topmost || e_object_is_del(E_OBJECT(topmost)) || !topmost->comp_data) return; - if (topmost->comp_data->sub.data) return; - _e_comp_wl_subsurface_check_below_bg_rectangle(topmost); - return; - } + topmost = e_comp_wl_topmost_parent_get(ec); + if (!topmost) + return; - if (ec->argb) - { - if (ec->comp_data->sub.below_obj) - { - ELOGF("COMP", "argb ec doesn't need below bg rectangle.", ec); - _e_comp_wl_subsurface_below_obj_destroy(ec); - } - return; - } + if ((!topmost->comp_data) || + (e_object_is_del(E_OBJECT(topmost)))) + return; - if (!ec->comp_data->sub.below_obj) + if (_e_comp_wl_subsurface_data_get(topmost)) + return; + + if (topmost->comp_data->sub.below_obj) { - if ((ec->comp_data->sub.below_list) || - (ec->comp_data->sub.below_list_pending) || - (_e_comp_wl_subsurface_video_has(ec))) + if ((topmost->argb) || + ((!topmost->comp_data->sub.below_list) && + (!topmost->comp_data->sub.below_list_pending) && + (!_e_comp_wl_subsurface_video_has(topmost)))) { - ELOGF("COMP", "it has below subsurfaces and video.", ec); - _e_comp_wl_subsurface_below_obj_create(ec); + ELOGF("COMP", "below_obj becomes useless. argb(%d)", + topmost, topmost->argb); + _e_comp_wl_subsurface_below_obj_destroy(topmost); } } else { - /* 'below_obj' has to be removed if it becomes useless. */ - if ((!ec->comp_data->sub.below_list) && - (!ec->comp_data->sub.below_list_pending) && - (!_e_comp_wl_subsurface_video_has(ec))) + if ((topmost->comp_data->sub.below_list) || + (topmost->comp_data->sub.below_list_pending) || + (_e_comp_wl_subsurface_video_has(topmost))) { - ELOGF("COMP", "it doesn't have any below subsurfaces and video.", - ec); - _e_comp_wl_subsurface_below_obj_destroy(ec); + ELOGF("COMP", "it has below subsurfaces and video.", topmost); + _e_comp_wl_subsurface_below_obj_create(topmost); } } } -- 2.34.1