int fd;
} presentation_sync;
+ struct {
+ pre_commit_cb_func_t func;
+ void *data;
+ callback_option option;
+ } pre_commit_cb;
+
tpl_gmutex surf_mutex;
tpl_gcond surf_cond;
* presentation feedback from display server */
int32_t presentation_sync_fd;
+ struct {
+ pre_commit_cb_func_t func;
+ void *data;
+ } pre_commit_cb;
+
tpl_gsource *waiting_source;
tpl_gmutex mutex;
private->create_commit_sync_fd = NULL;
private->create_presentation_sync_fd = NULL;
private->merge_sync_fds = NULL;
+ private->set_pre_commit_callback = NULL;
}
return private;
return presentation_sync_fd;
}
+
+static void
+__set_pre_commit_callback(void *private,
+ pre_commit_cb_func_t func, void *data, callback_option option)
+{
+ struct tizen_private tizen_private(private);
+ tpl_wl_egl_surface_t wl_egl_surface(tizen_private->data);
+
+ if (wl_egl_surface) {
+ wl_egl_surface->pre_commit_cb.func = func;
+ wl_egl_surface->pre_commit_cb.data = data;
+ wl_egl_surface->pre_commit_cb.option = option;
+
+ TPL_LOG_D("[SET_PRE_COMMIT_CALLBACK]", "wl_egl_surface(%p) option(%d)",
+ wl_egl_surface, option);
+ }
+}
/* -- END -- wl_egl_window tizen private callback functions */
/* -- BEGIN -- tizen_surface_shm_flusher_listener */
#else
tizen_private->create_presentation_sync_fd = NULL;
#endif
+ tizen_private->set_pre_commit_callback = (void *)__set_pre_commit_callback;
wl_egl_window->destroy_window_callback = (void *)__cb_destroy_callback;
wl_egl_window->resize_callback = (void *)__cb_resize_callback;
tizen_private->set_frontbuffer_callback = NULL;
tizen_private->merge_sync_fds = NULL;
tizen_private->data = NULL;
+ tizen_private->set_pre_commit_callback = NULL;
free(tizen_private);
wl_egl_window->driver_private = NULL;
wl_egl_buffer->rects = NULL;
wl_egl_buffer->num_rects = 0;
}
+
+ wl_egl_buffer->pre_commit_cb.func = NULL;
+ wl_egl_buffer->pre_commit_cb.data = NULL;
}
static tpl_wl_egl_buffer_t *
wl_egl_surface->serial_updated = TPL_FALSE;
}
+ if (wl_egl_surface->pre_commit_cb.func) {
+ wl_egl_buffer->pre_commit_cb.func = wl_egl_surface->pre_commit_cb.func;
+ wl_egl_buffer->pre_commit_cb.data = wl_egl_surface->pre_commit_cb.data;
+
+ if (wl_egl_surface->pre_commit_cb.option == ONCE) {
+ wl_egl_surface->pre_commit_cb.func = NULL;
+ wl_egl_surface->pre_commit_cb.data = NULL;
+ }
+ }
+
tpl_gmutex_lock(&wl_egl_surface->presentation_sync.mutex);
if (wl_egl_surface->presentation_sync.fd != -1) {
wl_egl_buffer->presentation_sync_fd = wl_egl_surface->presentation_sync.fd;
wl_egl_window->attached_height = wl_egl_buffer->height;
}
+ if (wl_egl_buffer->pre_commit_cb.func) {
+ wl_egl_buffer->pre_commit_cb.func(wl_egl_buffer->pre_commit_cb.data);
+ wl_egl_buffer->pre_commit_cb.func = NULL;
+ wl_egl_buffer->pre_commit_cb.data = NULL;
+ }
+
wl_surface_attach(wl_surface, (void *)wl_egl_buffer->wl_buffer,
wl_egl_buffer->dx, wl_egl_buffer->dy);