*/
void * tpl_object_get_user_data(tpl_object_t *object);
-tpl_backend_type_t tpl_display_choose_backend_type(tpl_handle_t native_dpy);
/**
* Create or get TPL display object for the given native display.
*
tpl_handle_t native_dpy);
/**
- * Get the backend type of a TPL display.
- *
- * @param display display to get type.
- * @return backend type of the given display.
- *
- * @see tpl_display_get()
- */
-tpl_backend_type_t tpl_display_get_backend_type(tpl_display_t *display);
-
-/**
* Get the native display handle which the given TPL display is created for.
*
* @param display display to get native handle.
int *visual_id,
int alpha_size);
-/**
- * Flush the TPL display.
- *
- * @param display display to flush.
- *
- * There might be pending operations on the given TPL display such as X11
- * native rendering. Flushing TPL display ensures that those pending operations
- * are done.
- */
-void tpl_display_flush(tpl_display_t *display);
/**
* Create a TPL surface for the given native surface.
#include "tpl_internal.h"
-void
-__tpl_display_flush(tpl_display_t *display)
-{
- TPL_ASSERT(display);
-
- if (display->backend.flush)
- display->backend.flush(display);
-}
-
static void
__tpl_display_fini(tpl_display_t *display)
{
free(display);
}
-tpl_backend_type_t
-tpl_display_choose_backend_type(tpl_handle_t native_dpy)
-{
- return __tpl_display_choose_backend(native_dpy);
-}
-
tpl_display_t *
tpl_display_get(tpl_backend_type_t type, tpl_handle_t native_dpy)
{
return display->backend.unbind_client_display_handle(display, native_dpy);
}
-tpl_backend_type_t
-tpl_display_get_backend_type(tpl_display_t *display)
-{
- if(NULL == display || TPL_TRUE != __tpl_object_is_valid(&display->base))
- {
- TPL_ERR("display is invalid!");
- return TPL_BACKEND_UNKNOWN;
- }
-
- return display->backend.type;
-}
-
tpl_handle_t
tpl_display_get_native_handle(tpl_display_t *display)
{
return display->backend.filter_config(display, visual_id, alpha_size);
}
-void
-tpl_display_flush(tpl_display_t *display)
-{
- if (display == NULL)
- __tpl_runtime_flush_all_display();
- else
- {
- TPL_OBJECT_LOCK(display);
- __tpl_display_flush(display);
- TPL_OBJECT_UNLOCK(display);
- }
-}
-
-void
-tpl_display_wait_native(tpl_display_t *display)
-{
- if(NULL == display || TPL_TRUE != __tpl_object_is_valid(&display->base))
- {
- TPL_ERR("display is invalid!");
- return;
- }
-
- display->backend.wait_native(display);
-}
-
tpl_bool_t
tpl_display_get_native_window_info(tpl_display_t *display, tpl_handle_t window,
int *width, int *height, tbm_format *format, int depth, int a_size)
return tbm_surface;
}
-static void
-__tpl_gbm_display_flush(tpl_display_t *display)
-{
- TPL_IGNORE(display);
-
- /* Do nothing. */
-}
-
static tpl_bool_t
__tpl_gbm_surface_init(tpl_surface_t *surface)
{
backend->get_window_info = __tpl_gbm_display_get_window_info;
backend->get_pixmap_info = __tpl_gbm_display_get_pixmap_info;
backend->get_buffer_from_native_pixmap = __tpl_gbm_display_get_buffer_from_native_pixmap;
- backend->flush = __tpl_gbm_display_flush;
#ifdef EGL_BIND_WL_DISPLAY
backend->bind_client_display_handle = __tpl_gbm_display_bind_client_wayland_display;
backend->unbind_client_display_handle = __tpl_gbm_display_unbind_client_wayland_display;
int *width, int *height, tbm_format *format);
tbm_surface_h (*get_buffer_from_native_pixmap)(tpl_handle_t pixmap);
-
- void (*flush)(tpl_display_t *display);
- void (*wait_native)(tpl_display_t *display);
-
};
struct _tpl_surface_backend
}
static void
-__tpl_tbm_display_flush(tpl_display_t *display)
-{
- TPL_IGNORE(display);
-
- /* Do nothing. */
-}
-
-static void
__tpl_tbm_surface_queue_notify_cb(tbm_surface_queue_h surface_queue, void *data)
{
/* Do something */
backend->get_window_info = __tpl_tbm_display_get_window_info;
backend->get_pixmap_info = __tpl_tbm_display_get_pixmap_info;
backend->get_buffer_from_native_pixmap = __tpl_tbm_display_get_buffer_from_native_pixmap;
- backend->flush = __tpl_tbm_display_flush;
}
void
}
static void
-__tpl_wayland_display_flush(tpl_display_t *display)
-{
- TPL_IGNORE(display);
-
- /* Do nothing. */
-}
-
-static void
__cb_client_window_resize_callback(struct wl_egl_window* wl_egl_window, void* private);
static tpl_bool_t
backend->query_config = __tpl_wayland_display_query_config;
backend->filter_config = __tpl_wayland_display_filter_config;
backend->get_window_info = __tpl_wayland_display_get_window_info;
- backend->get_pixmap_info = NULL;
- backend->flush = __tpl_wayland_display_flush;
- backend->bind_client_display_handle = NULL;
- backend->unbind_client_display_handle = NULL;
}
void