tpl_wayland_egl_thread: Simplified the name of internal functions. 78/134978/4
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 25 Apr 2017 12:35:48 +0000 (21:35 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Wed, 21 Jun 2017 07:04:26 +0000 (16:04 +0900)
Change-Id: I6182eb953091ad5fdabd738248832dcf9ec27b9d
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index ce4a472..89ac01f 100644 (file)
@@ -372,54 +372,8 @@ twe_display_del(twe_display_h twe_display)
        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);
@@ -444,8 +398,7 @@ __cb_client_window_resize_callback(struct wl_egl_window *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);
@@ -460,8 +413,8 @@ __cb_client_window_rotate_callback(struct wl_egl_window *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);
@@ -477,15 +430,15 @@ __cb_client_window_get_rotation_capability(struct wl_egl_window *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;
@@ -499,6 +452,50 @@ __cb_tbm_surface_queue_acquirable_callback(tbm_surface_queue_h surface_queue,
        }
 }
 
+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,
@@ -526,7 +523,7 @@ _twe_surface_create_tbm_queue(twe_wl_surf_source *source,
        }
 
        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);
@@ -535,7 +532,7 @@ _twe_surface_create_tbm_queue(twe_wl_surf_source *source,
        }
 
        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);
@@ -622,10 +619,10 @@ twe_surface_add(twe_thread* thread,
        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));