return TPL_ERROR_NONE;
}
-static gboolean
-_twe_thread_wl_surface_dispatch(GSource *source, GSourceFunc cb, gpointer date)
-{
- twe_wl_surf_source *wl_surf_source = (twe_wl_surf_source *)source;
- GIOCondition cond;
-
- cond = g_source_query_unix_fd(source, wl_surf_source->tag);
-
- if (cond & G_IO_IN) {
- ssize_t s;
- uint64_t u;
-
- TPL_LOG_T("WL_EGL", "finalize| gsource(%p) read event_fd(%d)",
- wl_surf_source, wl_surf_source->event_fd);
- s = read(wl_surf_source->event_fd, &u, sizeof(uint64_t));
- if (s != sizeof(uint64_t))
- TPL_ERR("Failed to read from event_fd(%d)\n",
- wl_surf_source->event_fd);
- }
-
- return G_SOURCE_CONTINUE;
-}
-
-static void
-_twe_thread_wl_surface_finalize(GSource *source)
-{
- twe_wl_surf_source *wl_surf_source = (twe_wl_surf_source *)source;
-
- g_source_remove_unix_fd(source, wl_surf_source->tag);
-
- TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)",
- source, wl_surf_source->event_fd);
- close(wl_surf_source->event_fd);
-
- return;
-}
-
-
-static GSourceFuncs _twe_wl_surface_funcs = {
- .prepare = NULL,
- .check = NULL,
- .dispatch = _twe_thread_wl_surface_dispatch,
- .finalize = _twe_thread_wl_surface_finalize,
-};
-
static void
-__cb_client_window_resize_callback(struct wl_egl_window *wl_egl_window,
- void *private)
+__cb_resize_callback(struct wl_egl_window *wl_egl_window, void *private)
{
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
}
static void
-__cb_client_window_rotate_callback(struct wl_egl_window *wl_egl_window,
- void *private)
+__cb_rotate_callback(struct wl_egl_window *wl_egl_window, void *private)
{
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
}
static int
-__cb_client_window_get_rotation_capability(struct wl_egl_window *wl_egl_window,
- void *private)
+__cb_get_rotation_capability(struct wl_egl_window *wl_egl_window,
+ void *private)
{
TPL_ASSERT(private);
TPL_ASSERT(wl_egl_window);
}
static void
-__cb_tbm_surface_queue_reset_callback(tbm_surface_queue_h tbm_queue,
- void *data)
+__cb_tbm_queue_reset_callback(tbm_surface_queue_h tbm_queue,
+ void *data)
{
TPL_DEBUG("tbm_queue(%p) has been reset!", tbm_queue);
}
static void
-__cb_tbm_surface_queue_acquirable_callback(tbm_surface_queue_h surface_queue,
- void *data)
+__cb_tbm_queue_acquirable_callback(tbm_surface_queue_h surface_queue,
+ void *data)
{
twe_wl_surf_source *source = (twe_wl_surf_source *)data;
uint64_t value = 1;
}
}
+static gboolean
+_twe_thread_wl_surface_dispatch(GSource *source, GSourceFunc cb, gpointer date)
+{
+ twe_wl_surf_source *wl_surf_source = (twe_wl_surf_source *)source;
+ GIOCondition cond;
+
+ cond = g_source_query_unix_fd(source, wl_surf_source->tag);
+
+ if (cond & G_IO_IN) {
+ ssize_t s;
+ uint64_t u;
+
+ TPL_LOG_T("WL_EGL", "finalize| gsource(%p) read event_fd(%d)",
+ wl_surf_source, wl_surf_source->event_fd);
+ s = read(wl_surf_source->event_fd, &u, sizeof(uint64_t));
+ if (s != sizeof(uint64_t))
+ TPL_ERR("Failed to read from event_fd(%d)",
+ wl_surf_source->event_fd);
+ }
+
+ return G_SOURCE_CONTINUE;
+}
+
+static void
+_twe_thread_wl_surface_finalize(GSource *source)
+{
+ twe_wl_surf_source *wl_surf_source = (twe_wl_surf_source *)source;
+
+ g_source_remove_unix_fd(source, wl_surf_source->tag);
+
+ TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)",
+ source, wl_surf_source->event_fd);
+ close(wl_surf_source->event_fd);
+
+ return;
+}
+
+static GSourceFuncs _twe_wl_surface_funcs = {
+ .prepare = NULL,
+ .check = NULL,
+ .dispatch = _twe_thread_wl_surface_dispatch,
+ .finalize = _twe_thread_wl_surface_finalize,
+};
+
static tbm_surface_queue_h
_twe_surface_create_tbm_queue(twe_wl_surf_source *source,
struct wayland_tbm_client *wl_tbm_client,
}
if (tbm_surface_queue_add_reset_cb(tbm_queue,
- __cb_tbm_surface_queue_reset_callback,
+ __cb_tbm_queue_reset_callback,
NULL) != TBM_SURFACE_QUEUE_ERROR_NONE) {
TPL_ERR("Failed to register reset callback to tbm_surface_queue(%p)",
tbm_queue);
}
if (tbm_surface_queue_add_acquirable_cb(tbm_queue,
- __cb_tbm_surface_queue_acquirable_callback,
+ __cb_tbm_queue_acquirable_callback,
(void *)source) != TBM_SURFACE_QUEUE_ERROR_NONE) {
TPL_ERR("Failed to register acquirable callback to tbm_surface_queue(%p)",
tbm_queue);
source->rotation_capability = TPL_FALSE;
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;
+ wl_egl_window->resize_callback = (void *)__cb_resize_callback;
+ wl_egl_window->rotate_callback = (void *)__cb_rotate_callback;
wl_egl_window->get_rotation_capability = (void *)
- __cb_client_window_get_rotation_capability;
+ __cb_get_rotation_capability;
g_source_set_callback(&source->gsource, NULL, surface, NULL);
g_source_attach(&source->gsource, g_main_loop_get_context(ctx->twe_loop));