e_comp_wl_buffer: Use ds_buffer_get_size() 89/303189/2
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 20 Dec 2023 01:22:21 +0000 (10:22 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Thu, 21 Dec 2023 05:00:17 +0000 (05:00 +0000)
Previously, the size of E_Comp_Wl_Buffer was set manually.
This patch uses ds_buffer_get_size() to obtain the size of the buffer
instead.

Change-Id: I592122a13a0551dd7f15b9752639fd7de2129958

src/bin/e_comp_wl_buffer.c

index 3179915..c2b0449 100644 (file)
@@ -155,8 +155,6 @@ _e_comp_wl_buffer_tbm_type_get(E_Comp_Wl_Buffer *base, struct ds_buffer *ds_buff
      return EINA_FALSE;
 
    base->type = E_COMP_WL_BUFFER_TYPE_TBM;
-   base->w = tbm_surface_get_width(tsurface);
-   base->h = tbm_surface_get_height(tsurface);
    base->format = tbm_surface_get_format(tsurface);
    base->tbm_surface = tsurface;
 
@@ -174,16 +172,12 @@ _e_comp_wl_buffer_init(E_Comp_Wl_Buffer *base, struct ds_buffer *ds_buffer)
    if (shmbuff)
      {
         base->type = E_COMP_WL_BUFFER_TYPE_SHM;
-        base->w = wl_shm_buffer_get_width(shmbuff);
-        base->h = wl_shm_buffer_get_height(shmbuff);
         base->format = wl_shm_buffer_get_format(shmbuff);
         base->shm_buffer = shmbuff;
      }
    else if (ds_single_pixel_buffer_v1_from_buffer(ds_buffer))
      {
         base->type = E_COMP_WL_BUFFER_TYPE_SINGLE_PIXEL;
-        base->w = 1;
-        base->h = 1;
         base->format = WL_SHM_FORMAT_ARGB8888;
      }
    else if (!_e_comp_wl_buffer_tbm_type_get(base, ds_buffer))
@@ -192,6 +186,7 @@ _e_comp_wl_buffer_init(E_Comp_Wl_Buffer *base, struct ds_buffer *ds_buffer)
         return EINA_FALSE;
      }
 
+   ds_buffer_get_size(ds_buffer, &base->w, &base->h);
    base->resource = resource;
 
    base->destroy_listener.notify = _e_buffer_cb_resource_destroy;