subsurface: cleanup for the below_obj of topmost. 28/241228/3
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 23 Jul 2020 06:41:24 +0000 (15:41 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Sun, 23 Aug 2020 23:37:04 +0000 (23:37 +0000)
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

index 102d521e85949e8cb73cc6b8000ee78719c447a4..dab627873f73a120ed473ee261faecd36ac29762 100644 (file)
@@ -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);
           }
      }
 }