tpl_wayland_egl_thread: Modified get_window_info internal function. 75/203475/2
authorJoonbum Ko <joonbum.ko@samsung.com>
Mon, 15 Apr 2019 05:55:41 +0000 (14:55 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 7 May 2019 00:12:08 +0000 (00:12 +0000)
 - Modified the internal function so that the first format can be maintained
  to avoid problems when a_size is changed in a way different from the format
  at the time of surface creation.

Change-Id: I8b65c5fb9a02f7b01286429735f703aad90adbfe
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c
src/tpl_wayland_egl_thread.h
src/tpl_wl_egl_thread.c

index 30227a0..8e65783 100644 (file)
@@ -3265,7 +3265,8 @@ twe_check_native_handle_is_wl_display(tpl_handle_t display)
 }
 
 tpl_result_t
-twe_get_native_window_info(tpl_handle_t window, int *width, int *height)
+twe_get_native_window_info(tpl_handle_t window, int *width, int *height,
+                                                  tbm_format *format, int a_size)
 {
        struct wl_egl_window *wl_egl_window = (struct wl_egl_window *)window;
        if (!wl_egl_window) {
@@ -3275,6 +3276,17 @@ twe_get_native_window_info(tpl_handle_t window, int *width, int *height)
 
        if (width) *width = wl_egl_window->width;
        if (height) *height = wl_egl_window->height;
+       if (format) {
+               if (wl_egl_window->private) {
+                       twe_wl_surf_source *surf_source = (twe_wl_surf_source *)wl_egl_window->private;
+                       *format = surf_source->format;
+               } else {
+                       if (a_size == 8)
+                               *format = TBM_FORMAT_ARGB8888;
+                       else
+                               *format = TBM_FORMAT_XRGB8888;
+               }
+       }
 
        return TPL_ERROR_NONE;
 }
index dfe6f6f..6cb9116 100644 (file)
@@ -105,7 +105,7 @@ tpl_bool_t
 twe_check_native_handle_is_wl_display(tpl_handle_t display);
 
 tpl_result_t
-twe_get_native_window_info(tpl_handle_t window, int *width, int *height);
+twe_get_native_window_info(tpl_handle_t window, int *width, int *height, tbm_format *format, int a_size);
 
 tbm_surface_h
 twe_get_native_buffer_from_pixmap(tpl_handle_t pixmap);
index bd7ecbb..4ebe168 100644 (file)
@@ -189,14 +189,7 @@ __tpl_wl_egl_display_get_window_info(tpl_display_t *display,
        TPL_ASSERT(display);
        TPL_ASSERT(window);
 
-       if (format) {
-               if (a_size == 8)
-                       *format = TBM_FORMAT_ARGB8888;
-               else
-                       *format = TBM_FORMAT_XRGB8888;
-       }
-
-       if ((ret = twe_get_native_window_info(window, width, height))
+       if ((ret = twe_get_native_window_info(window, width, height, format, a_size))
                        != TPL_ERROR_NONE) {
                TPL_ERR("Failed to get size info of native_window(%p)", window);
        }