Revert "[evas_gl_thread] separates wl_egl_xxX API calls into threads." 57/139857/1
authorBoram Park <boram1288.park@samsung.com>
Fri, 21 Jul 2017 01:00:03 +0000 (10:00 +0900)
committerBoram Park <boram1288.park@samsung.com>
Fri, 21 Jul 2017 01:00:31 +0000 (10:00 +0900)
This reverts commit 8c9470c0133a076f67535b5655a3d850e9e9a904.

Change-Id: I500e92388f550a18acd829bc831c81e1b585c7f1

src/lib/evas/common/evas_thread_render.c
src/modules/evas/engines/gl_common/evas_gl_thread_egl.c
src/modules/evas/engines/gl_common/evas_gl_thread_egl.h
src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
src/modules/evas/engines/wayland_egl/evas_wl_main.c

index ee3ca4f..1f473cc 100644 (file)
@@ -333,7 +333,7 @@ evas_threads_sw_init(void)
 fail_on_software_thread_init:
   eina_threads_shutdown();
 fail_on_eina_thread_init:
-  return --evas_threads_sw_init_count;
+  return --evas_threads_gl_init_count;
 }
 
 EAPI int
index 74d7e2d..21125b2 100644 (file)
@@ -611,61 +611,6 @@ eglQueryWaylandBuffer_thread_cmd(EGLDisplay dpy, void *buffer, EGLint attribute,
    return thread_data.return_value;
 }
 
-typedef struct
-{
-   void *win;
-   int w, h;
-   int rot, info_rot, window_rotation;
-   int info_edges;
-   WL_EGL_RECONFIG func_reconfig;
-} Evas_Thread_Command_eglWindowReconfig;
-
-static void
-_gl_thread_eglWindowReconfig(void *data)
-{
-  Evas_Thread_Command_eglWindowReconfig *thread_data = data;
-
-  /* set outbuf rotation -> it is screen rotation */
-  if (thread_data->func_reconfig)
-    thread_data->func_reconfig(thread_data->win, thread_data->w, thread_data->h, thread_data->rot, thread_data->info_rot,
-                               thread_data->window_rotation, thread_data->info_edges);
-
-}
-
-
-
-EAPI void
-eglWindowReconfig_thread_cmd(void *win, int w, int h, int rot, int info_rot,
-                             int window_rotation, int info_edges, WL_EGL_RECONFIG fn_wl_egl_reconfig)
-{
-   if (!evas_gl_thread_enabled())
-     {
-       if (fn_wl_egl_reconfig)
-         fn_wl_egl_reconfig(win, w, h, rot, info_rot, window_rotation, info_edges);
-       return;
-     }
-
-   Evas_Thread_Command_eglWindowReconfig thread_data_local;
-   Evas_Thread_Command_eglWindowReconfig *thread_data = &thread_data_local;
-
-   int thread_mode = EVAS_GL_THREAD_MODE_FINISH;
-
-   thread_data->win = win;
-   thread_data->w = w;
-   thread_data->h = h;
-   thread_data->rot = rot;
-   thread_data->info_rot = info_rot;
-   thread_data->window_rotation = window_rotation;
-   thread_data->info_edges = info_edges;
-   thread_data->func_reconfig = fn_wl_egl_reconfig;
-
-
-   evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL,
-                              _gl_thread_eglWindowReconfig,
-                              thread_data,
-                              thread_mode);
-
-}
 
 
 /***** EVAS GL *****/
@@ -1039,8 +984,6 @@ void       (*eglQueryWaylandBuffer_orig_evas_set)(void *func);
 void      *(*eglQueryWaylandBuffer_orig_evas_get)();
 EGLBoolean (*eglQueryWaylandBuffer_thread_cmd)(EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value);
 
-void (*eglWindowReconfig_thread_cmd)(void *win, int w, int h, int rot, int info_rot, int window_rotation, int info_edges, WL_EGL_RECONFIG fn_wl_egl_reconfig);
-
 
 /***** EVAS GL *****/
 
@@ -1092,8 +1035,6 @@ void _egl_thread_link_init()
    LINK2GENERIC(eglQueryWaylandBuffer_orig_evas_get);
    LINK2GENERIC(eglQueryWaylandBuffer_thread_cmd);
 
-   LINK2GENERIC(eglWindowReconfig_thread_cmd);
-
    /***** EVAS GL *****/
 
    LINK2GENERIC(eglGetError_evgl_thread_cmd);
index 4341334..e70dba8 100644 (file)
@@ -5,9 +5,6 @@
 
 #include <EGL/egl.h>
 
-
-typedef void (*WL_EGL_RECONFIG)(void *win, int w, int h, int rot, int info_rot, int window_rotation, int info_edges);
-
 #ifdef EVAS_GL_RENDER_THREAD_COMPILE_FOR_GL_GENERIC
 
 
@@ -70,8 +67,6 @@ EAPI void       eglGetProcAddress_orig_evas_set(void *func);
 EAPI void      *eglGetProcAddress_orig_evas_get();
 EAPI void      *eglGetProcAddress_thread_cmd(char const * procname);
 
-EAPI void       eglWindowReconfig_thread_cmd(void *win, int w, int h, int rot, int info_rot, int window_rotation, int info_edges, WL_EGL_RECONFIG fn_wl_egl_reconfig);
-
 /***** EVAS GL *****/
 
 /* EGL 1.4 Referencing to Thread Local Storage */
@@ -118,7 +113,6 @@ extern EGLBoolean (*eglSetDamageRegion_thread_cmd)(EGLDisplay dpy, EGLSurface su
 extern void       (*eglQueryWaylandBuffer_orig_evas_set)(void *func);
 extern void      *(*eglQueryWaylandBuffer_orig_evas_get)();
 extern EGLBoolean (*eglQueryWaylandBuffer_thread_cmd)(EGLDisplay dpy, void *buffer, EGLint attribute, EGLint *value);
-extern void       (*eglWindowReconfig_thread_cmd)(void *win, int w, int h, int rot, int info_rot, int window_rotation, int info_edges, WL_EGL_RECONFIG fn_wl_egl_reconfig);
 
 
 /***** EVAS GL *****/
index 6617b85..6767e1c 100644 (file)
@@ -51,7 +51,7 @@ struct _Evas_Engine_Info_Wayland_Egl
    int           stencil_bits;
    int           msaa_bits;
 
-   int           window_rotation;
+   int window_rotation;
 };
 
 #endif
index acfa20a..e9a9687 100644 (file)
@@ -525,45 +525,7 @@ eng_window_resurf(Outbuf *gw)
    gw->surf = EINA_TRUE;
 }
 
-void
-_wl_egl_window_reconfig(void *win, int w, int h, int rot, int info_rot, int window_rotation, int info_edges)
-{
-
-  int aw, ah, dx = 0, dy = 0;
-
-  if ((info_rot == 90) || (info_rot == 270))
-    wl_egl_window_get_attached_size(win, &ah, &aw);
-  else
-    wl_egl_window_get_attached_size(win, &aw, &ah);
-
-  if (info_edges & 4) // resize from left
-    {
-       if ((info_rot == 90) || (info_rot == 270))
-         dx = ah - h;
-       else
-         dx = aw - w;
-    }
-
-  if (info_edges & 1) // resize from top
-    {
-       if ((info_rot == 90) || (info_rot == 270))
-         dy = aw - w;
-       else
-         dy = ah - h;
-    }
-
-  /* set outbuf rotation -> it is screen rotation */
-  wl_egl_window_set_buffer_transform(win, rot / 90);
-  wl_egl_window_set_window_transform(win, window_rotation / 90);
-
-  if ((info_rot == 90) || (info_rot == 270))
-    wl_egl_window_resize(win, h, w, dx, dy);
-  else
-    wl_egl_window_resize(win, w, h, dx, dy);
-}
-
-
-void
+void 
 eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth EINA_UNUSED)
 {
    ob->w = w;
@@ -575,18 +537,55 @@ eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth EIN
    glsym_evas_gl_common_context_resize(ob->gl_context, w, h, ob->rot,1);
 
    if (ob->win)
-        eglWindowReconfig_thread_cmd(ob->win, w, h,  ob->rot, ob->info->info.rotation,
-                                     ob->info->window_rotation, ob->info->info.edges,
-                                     _wl_egl_window_reconfig);
+     {
+        int aw, ah, dx = 0, dy = 0;
+
+        if ((ob->info->info.rotation == 90) || (ob->info->info.rotation == 270))
+          wl_egl_window_get_attached_size(ob->win, &ah, &aw);
+        else
+          wl_egl_window_get_attached_size(ob->win, &aw, &ah);
+
+        if (ob->info->info.edges & 4) // resize from left
+          {
+             if ((ob->info->info.rotation == 90) || (ob->info->info.rotation == 270))
+               dx = ah - h;
+             else
+               dx = aw - w;
+          }
+
+        if (ob->info->info.edges & 1) // resize from top
+          {
+             if ((ob->info->info.rotation == 90) || (ob->info->info.rotation == 270))
+               dy = aw - w;
+             else
+               dy = ah - h;
+          }
+
+        /* buffer_transform: screen rotation + window rotation
+         * window_transform: window rotation only
+         * We have to let the display server know the window rotation value
+         * because the display server needs to calcuate the screen rotation value
+         * from buffer_transform value.
+         */
+        wl_egl_window_set_buffer_transform(ob->win, ob->info->info.rotation / 90);
+        wl_egl_window_set_window_transform(ob->win, ob->info->window_rotation / 90);
+
+        if ((ob->info->info.rotation == 90) || (ob->info->info.rotation == 270))
+          wl_egl_window_resize(ob->win, h, w, dx, dy);
+        else
+          wl_egl_window_resize(ob->win, w, h, dx, dy);
+
+
+     }
 }
 
-int
+int 
 eng_outbuf_rotation_get(Outbuf *ob)
 {
    return ob->rot;
 }
 
-Render_Engine_Swap_Mode
+Render_Engine_Swap_Mode 
 eng_outbuf_swap_mode_get(Outbuf *ob)
 {
    if ((ob->swap_mode == MODE_AUTO) && (extn_have_buffer_age))