tpl_wayland_egl: Registered a callback function to set frontbuffer mode. 00/130400/1
authorjoonbum.ko <joonbum.ko@samsung.com>
Mon, 22 May 2017 07:40:09 +0000 (16:40 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Mon, 22 May 2017 07:40:09 +0000 (16:40 +0900)
Change-Id: I03267086c07b258b6453dd9fe1fcd42bcbf503cc
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl.c

index e05c845..5e83345 100644 (file)
@@ -379,6 +379,10 @@ static int
 __cb_client_window_get_rotation_capability(struct wl_egl_window *wl_egl_window,
                                                                                   void *private);
 
+static void
+__cb_client_window_set_frontbuffer_mode(struct wl_egl_window *wl_egl_window,
+                                                                               void *private, int set);
+
 static TPL_INLINE void
 __tpl_wayland_egl_buffer_set_reset_flag(tpl_list_t *tracking_list)
 {
@@ -556,6 +560,8 @@ __tpl_wayland_egl_surface_init(tpl_surface_t *surface)
        wl_egl_window->rotate_callback = (void *)__cb_client_window_rotate_callback;
        wl_egl_window->get_rotation_capability = (void *)
                        __cb_client_window_get_rotation_capability;
+       wl_egl_window->set_frontbuffer_callback = (void *)
+                       __cb_client_window_set_frontbuffer_mode;
 
        /* tdm_vblank object decide to be maintained every tpl_wayland_egl_surface
           for the case where the several surfaces is created in one display connection. */
@@ -1095,6 +1101,8 @@ __tpl_wayland_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeou
                        return surface->frontbuffer;
                } else
                        surface->frontbuffer = NULL;
+       } else {
+               surface->frontbuffer = NULL;
        }
 
        tsq_err = tbm_surface_queue_dequeue(wayland_egl_surface->tbm_queue,
@@ -1397,6 +1405,19 @@ __cb_client_window_get_rotation_capability(struct wl_egl_window *wl_egl_window,
        return rotation_capability;
 }
 
+static void
+__cb_client_window_set_frontbuffer_mode(struct wl_egl_window *wl_egl_window,
+                                                                               void *private, int set)
+{
+       TPL_ASSERT(private);
+       TPL_ASSERT(wl_egl_window);
+       tpl_surface_t *surface = (tpl_surface_t *)private;
+
+       if (set)
+               surface->is_frontbuffer_mode = TPL_TRUE;
+       else
+               surface->is_frontbuffer_mode = TPL_FALSE;
+}
 
 void
 __cb_resistry_global_callback(void *data, struct wl_registry *wl_registry,