tpl_wayland_egl_thread: Registered wl_egl_window rotate callback. 73/134973/3
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 25 Apr 2017 10:39:51 +0000 (19:39 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 21 Jun 2017 07:04:25 +0000 (16:04 +0900)
Change-Id: Ie5a6afc303bf36cceca6046e053450bb9b42b04a
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index ef38f00..0a095ca 100644 (file)
@@ -67,6 +67,7 @@ struct _twe_wl_surf_source {
        int event_fd;
        struct wl_surface *surf;
        struct wl_egl_window *wl_egl_window;
+       int rotation;
        tbm_surface_queue_h tbm_queue;
        twe_wl_disp_source *disp_source;
 };
@@ -442,6 +443,22 @@ __cb_client_window_resize_callback(struct wl_egl_window *wl_egl_window,
 }
 
 static void
+__cb_client_window_rotate_callback(struct wl_egl_window *wl_egl_window,
+                                                                  void *private)
+{
+       TPL_ASSERT(private);
+       TPL_ASSERT(wl_egl_window);
+
+       int rotation = wl_egl_window->rotation;
+       twe_wl_surf_source *source = (twe_wl_surf_source *)private;
+
+       TPL_LOG_T("WL_EGL", "[ROTATE_CB] wl_egl_window(%p) (%d) -> (%d)",
+                         wl_egl_window, source->rotation, rotation);
+
+       source->rotation = rotation;
+}
+
+static void
 __cb_tbm_surface_queue_reset_callback(tbm_surface_queue_h tbm_queue,
                                                                          void *data)
 {
@@ -555,9 +572,11 @@ twe_surface_add(twe_thread* thread,
        source->wl_egl_window = wl_egl_window;
        source->tbm_queue = tbm_queue;
        source->disp_source = (twe_wl_disp_source *)twe_display;
+       source->rotation = 0;
 
        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;
 
        g_source_set_callback(&source->gsource, NULL, surface, NULL);
        g_source_attach(&source->gsource, g_main_loop_get_context(ctx->twe_loop));