fail_on_software_thread_init:
eina_threads_shutdown();
fail_on_eina_thread_init:
- return --evas_threads_gl_init_count;
+ return --evas_threads_sw_init_count;
}
EAPI int
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 *****/
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 *****/
LINK2GENERIC(eglQueryWaylandBuffer_orig_evas_get);
LINK2GENERIC(eglQueryWaylandBuffer_thread_cmd);
+ LINK2GENERIC(eglWindowReconfig_thread_cmd);
+
/***** EVAS GL *****/
LINK2GENERIC(eglGetError_evgl_thread_cmd);
#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
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 */
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 *****/
int stencil_bits;
int msaa_bits;
- int window_rotation;
+ int window_rotation;
};
#endif
gw->surf = EINA_TRUE;
}
-void
+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
eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth EINA_UNUSED)
{
ob->w = w;
glsym_evas_gl_common_context_resize(ob->gl_context, w, h, ob->rot,1);
if (ob->win)
- {
- 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);
-
-
- }
+ 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
+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))