e_pixmap: Remove cdata from E_Pixmap 44/316244/1
authorSeunghun Lee <shiin@samsung.com>
Tue, 10 Dec 2024 00:11:27 +0000 (09:11 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 12 Dec 2024 05:26:34 +0000 (14:26 +0900)
The cdata of E_Pixmap was first introduced because the user data of
wl_surface was E_Pixmap at the time.
Now that the E_Client is the user data of wl_surface, we should remove
duplicated cdata from E_Pixmap.

Change-Id: Iab03307b05f467e64bc3948b39c5734c8cb83f67

src/bin/core/e_pixmap.c
src/bin/core/e_pixmap_intern.h
src/bin/server/e_compositor.c

index cbb09c722832020d513f52f41cc267e1de46b895..3ec40bb53498d5f6da17e0bd45108e3bf939fedb 100644 (file)
@@ -40,9 +40,6 @@ struct _E_Pixmap
    Eina_Rectangle opaque;
    uuid_t uuid;
 
-   E_Comp_Wl_Client_Data *cdata;
-   Eina_Bool own_cdata : 1;
-
    Eina_Bool usable : 1;
    Eina_Bool dirty : 1;
    Eina_Bool image_argb : 1;
@@ -132,11 +129,6 @@ _e_pixmap_clear(E_Pixmap *cp, Eina_Bool cache)
 static void
 _e_pixmap_free(E_Pixmap *cp)
 {
-   if (cp->own_cdata)
-     {
-        E_FREE(cp->cdata);
-        cp->own_cdata = EINA_FALSE;
-     }
    if (cp->data_pool)
      {
         if (cp->client && cp->client->frame)
@@ -167,19 +159,7 @@ _e_pixmap_new(E_Pixmap_Type type)
    cp->w = cp->h = 0;
    cp->refcount = 1;
    cp->dirty = 1;
-   cp->cdata = E_NEW(E_Comp_Wl_Client_Data, 1);
    cp->buffer_destroy_listener.notify = _e_pixmap_cb_buffer_destroy;
-   if (!cp->cdata)
-     {
-        E_FREE(cp);
-        return NULL;
-     }
-   cp->cdata->pending.buffer_viewport.buffer.transform = WL_OUTPUT_TRANSFORM_NORMAL;
-   cp->cdata->pending.buffer_viewport.buffer.scale = 1;
-   cp->cdata->pending.buffer_viewport.buffer.src_width = wl_fixed_from_int(-1);
-   cp->cdata->pending.buffer_viewport.surface.width = -1;
-   cp->cdata->pending.buffer_viewport.changed = 0;
-   cp->own_cdata = EINA_TRUE;
 
    wl_signal_init(&cp->events.destroy);
    wl_signal_init(&cp->events.buffer_clear);
@@ -261,9 +241,6 @@ _e_pixmap_id_setup(E_Pixmap *cp, uintptr_t id)
      {
         surface_resource = (struct wl_resource *)id;
 
-        if (cp->cdata)
-             cp->cdata->wl_surface = surface_resource;
-
         cp->surface_resource_destroy.notify = _e_pixmap_cb_surface_resource_destroy;
         wl_resource_add_destroy_listener(surface_resource, &cp->surface_resource_destroy);
      }
@@ -850,33 +827,8 @@ E_API E_Comp_Wl_Client_Data *
 e_pixmap_cdata_get(E_Pixmap *cp)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp, NULL);
-   return (E_Comp_Wl_Client_Data*)cp->cdata;
-}
-
-EINTERN void
-e_pixmap_cdata_set(E_Pixmap *cp, E_Comp_Wl_Client_Data *cdata)
-{
-   E_Comp_Wl_Client_Data *cd = (E_Comp_Wl_Client_Data*)cdata;
-
-   EINA_SAFETY_ON_NULL_RETURN(cp);
-
-   if (cp->cdata)
-     {
-        if (cp->own_cdata)
-          {
-             if (cd)
-               {
-                  cd->wl_surface = cp->cdata->wl_surface;
-                  cd->scaler.viewport = cp->cdata->scaler.viewport;
-                  cd->pending.buffer_viewport = cp->cdata->pending.buffer_viewport;
-               }
-
-             E_FREE(cp->cdata);
-             cp->own_cdata = EINA_FALSE;
-          }
-     }
-
-   cp->cdata = cd;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(cp->client, NULL);
+   return e_client_cdata_get(cp->client);
 }
 
 E_API E_Pixmap_Hook *
index b68bd2f365c8b8422164e50f43bca510c85643ff..7a8127f1592cdf2cdd6dce003d9ae6a3aad8ac25 100644 (file)
@@ -17,7 +17,6 @@ EINTERN Eina_Bool e_pixmap_init(void);
 EINTERN void      e_pixmap_shutdown(void);
 
 EINTERN void          e_pixmap_win_id_del(E_Pixmap *cp);
-EINTERN void          e_pixmap_cdata_set(E_Pixmap *cp, E_Comp_Wl_Client_Data *cdata);
 EINTERN Eina_Bool     e_pixmap_dirty_get(E_Pixmap *cp);
 EINTERN void          e_pixmap_usable_set(E_Pixmap *cp, Eina_Bool set);
 EINTERN void          e_pixmap_dirty(E_Pixmap *cp);
index b670a6f9bee8642a0be1e5449653801ad4f610ea..4a13ab26269c4730e0dffdfc8e37331ae0cc1b12 100644 (file)
@@ -817,8 +817,6 @@ _e_compositor_cb_new_client(void *data EINA_UNUSED, E_Client *ec)
    if (ec->internal)
      ec->icccm.delete_request = EINA_TRUE;
 
-   e_pixmap_cdata_set(ec->pixmap, &surface->base);
-
    g_mutex_init(&ec->comp_data->surface_mutex);
 
    TRACE_DS_END();
@@ -1238,8 +1236,6 @@ _e_surface_cb_client_del(void *data, E_Client *ec)
 
    e_comp_wl_client_evas_deinit(ec);
 
-   e_pixmap_cdata_set(ec->pixmap, NULL);
-
    _e_surface_destroy(surface);
 
    TRACE_DS_END();