}
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) {
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;
}
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);
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);
}