void (*set_frontbuffer_callback)(struct wl_egl_window *, void *, int);
void (*set_window_serial_callback)(struct wl_egl_window *, void *, unsigned int);
int (*create_render_sync_fd)(struct wl_egl_window *, void *);
+ int (*create_presentation_sync_fd)(struct wl_egl_window *, void *);
};
static struct tizen_private* tizen_private_create()
private->set_window_serial_callback = NULL;
private->set_frontbuffer_callback = NULL;
private->create_render_sync_fd = NULL;
+ private->create_presentation_sync_fd = NULL;
}
return private;
return -1;
}
+
+int
+wl_egl_window_tizen_create_presentation_sync_fd(struct wl_egl_window *egl_window)
+{
+ struct tizen_private *private = NULL;
+
+ if (egl_window == NULL) {
+ WL_EGL_ERR("egl_window is NULL");
+ return -1;
+ }
+
+ private = egl_window->driver_private;
+ if (private == NULL) {
+ WL_EGL_ERR("wl_egl_window(%p) dirver_private is NULL", egl_window);
+ return -1;
+ }
+
+ if (private->create_presentation_sync_fd)
+ return private->create_presentation_sync_fd(egl_window, egl_window->driver_private);
+
+ return -1;
+}
int
wl_egl_window_tizen_create_render_sync_fd(struct wl_egl_window *egl_window);
+/**
+ * Create a sync fence fd that can tell presentation done.
+ *
+ * It returns fd which tells when the presentation is finished.
+ * This fd can wait asynchronously via poll or select.
+ *
+ * Important *
+ * This fence lets caller knows when wl_surface received PRESENT or DISCARD
+ * events from the server.
+ * In case of receiving DISCARD, it is not actually displayed on the display,
+ * but it releases the fence like PRESENT.
+ * In most cases that are not complicated, attached buffer will not be discarded.
+ *
+ * @param egl_window handle to wl_egl_window.
+ * @return sync fd on success, -1 on failure.
+ */
+int
+wl_egl_window_tizen_create_presentation_sync_fd(struct wl_egl_window *egl_window);
+
#ifdef __cplusplus
}
#endif