From c401d2f7b9f1211871f395b426e45549571731a8 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 25 Apr 2017 20:12:26 +0900 Subject: [PATCH] tpl_wayland_egl_thread: Registered wl_egl_window get_rotation_capability callback. Change-Id: I2753c8e4b658cdc95c6992976c9db0142d5a572c Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index c66d290..4a7f899 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -459,6 +459,23 @@ __cb_client_window_rotate_callback(struct wl_egl_window *wl_egl_window, source->rotation = rotation; } +static int +__cb_client_window_get_rotation_capability(struct wl_egl_window *wl_egl_window, + void *private) +{ + TPL_ASSERT(private); + TPL_ASSERT(wl_egl_window); + + int rotation_capability = WL_EGL_WINDOW_CAPABILITY_NONE; + twe_wl_surf_source *source = (twe_wl_surf_source *)private; + if (source->rotation_capability == TPL_TRUE) + rotation_capability = WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED; + else + rotation_capability = WL_EGL_WINDOW_CAPABILITY_ROTATION_UNSUPPORTED; + + return rotation_capability; +} + static void __cb_tbm_surface_queue_reset_callback(tbm_surface_queue_h tbm_queue, void *data) @@ -579,6 +596,8 @@ twe_surface_add(twe_thread* thread, wl_egl_window->private = (void *)source; wl_egl_window->resize_callback = (void *)__cb_client_window_resize_callback; wl_egl_window->rotate_callback = (void *)__cb_client_window_rotate_callback; + wl_egl_window->get_rotation_capability = (void *) + __cb_client_window_get_rotation_capability; g_source_set_callback(&source->gsource, NULL, surface, NULL); g_source_attach(&source->gsource, g_main_loop_get_context(ctx->twe_loop)); -- 2.7.4