tpl_wayland_egl_thread: Registered wl_egl_window get_rotation_capability callback. 76/134976/3
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 25 Apr 2017 11:12:26 +0000 (20:12 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 21 Jun 2017 07:04:25 +0000 (16:04 +0900)
Change-Id: I2753c8e4b658cdc95c6992976c9db0142d5a572c
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index c66d290..4a7f899 100644 (file)
@@ -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));