Revert "e_comp_wl_subsurface: Utilize E_Surface" 78/316678/1
authorSeunghun Lee <shiin.lee@samsung.com>
Mon, 26 Aug 2024 07:28:55 +0000 (16:28 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 26 Aug 2024 22:50:13 +0000 (07:50 +0900)
This reverts commit 90b50aa3b750145da3d6211e921131cabf2791a9.

There are two types of subsurface for now, E_Subsurface and
E_Video_Viewport_Source. So, the functions e_comp_wl_subsurface_check()
and e_comp_wl_subsurface_parent_get() should not rely on E_Subsurface.

Change-Id: I7b298045cf4c34c8caa491aea94aafe975496035

src/bin/server/e_comp_wl_subsurface.c
src/bin/server/e_compositor.c
src/bin/server/e_compositor_intern.h

index 354283c..85130f9 100644 (file)
@@ -1,7 +1,6 @@
 #include "e_comp_wl_subsurface_intern.h"
 #include "e_comp_wl_intern.h"
 #include "e_comp_wl_viewport_intern.h"
-#include "e_compositor_intern.h"
 #include "e_pixmap_intern.h"
 #include "e_client_video_intern.h"
 #include "e_client_intern.h"
@@ -836,30 +835,16 @@ EINTERN Eina_Bool
 e_comp_wl_subsurface_check(E_Client *ec)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
-
-   return !!e_subsurface_try_from_ec(ec);
+   return ec->comp_data ? !!ec->comp_data->sub.data : EINA_FALSE;
 }
 
 EINTERN E_Client *
 e_comp_wl_subsurface_parent_get(E_Client *ec)
 {
-   E_Surface *surface;
-   E_Subsurface *subsurface;
-
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec, NULL);
-
-   surface = e_surface_try_from_ec(ec);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
-
-   subsurface = e_subsurface_try_from_surface(surface);
-   if (!subsurface)
-     return NULL;
-
-   surface = e_subsurface_parent_try_get(subsurface);
-   if (!surface)
-     return NULL;
-
-   return e_surface_ec_get(surface);
+   /* Must be called with valid comp_data. */
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, NULL);
+   return ec->comp_data->sub.data ? ec->comp_data->sub.data->parent : NULL;
 }
 
 EINTERN Eina_Bool
index 31068a9..14420e8 100644 (file)
@@ -641,20 +641,11 @@ e_subsurface_from_ec(E_Client *ec)
 {
    E_Subsurface *subsurface;
 
-   assert(ec->comp_data && ec->comp_data->sub.data);
+   assert(ec->comp_data->sub.data);
 
    return wl_container_of(ec->comp_data->sub.data, subsurface, base);
 }
 
-EINTERN E_Subsurface *
-e_subsurface_try_from_ec(E_Client *ec)
-{
-   if ((!ec->comp_data) || (!ec->comp_data->sub.data))
-     return NULL;
-
-   return e_subsurface_from_ec(ec);
-}
-
 EINTERN Eina_Bool
 e_subsurface_position_set(E_Subsurface *subsurface, int x, int y)
 {
index 6b771ae..8dcdf02 100644 (file)
@@ -50,7 +50,6 @@ E_Subsurface *e_subsurface_create(struct wl_resource *factory_resource, uint32_t
 E_Subsurface *e_subsurface_from_resource(struct wl_resource *resource);
 E_Subsurface *e_subsurface_try_from_surface(E_Surface *surface);
 E_Subsurface *e_subsurface_from_ec(E_Client *ec);
-E_Subsurface *e_subsurface_try_from_ec(E_Client *ec);
 Eina_Bool e_subsurface_position_set(E_Subsurface *subsurface, int x, int y);
 void e_subsurface_destroy_listener_add(E_Subsurface *subsurface, struct wl_listener *listener);
 void e_subsurface_reposition_listener_add(E_Subsurface *subsurface, struct wl_listener *listener);