diff options
author | Haegeun Park <haegeun.park@samsung.com> | 2016-10-17 15:18:12 +0900 |
---|---|---|
committer | Haegeun Park <haegeun.park@samsung.com> | 2017-01-11 18:20:38 +0900 |
commit | 923d01d7ed1555902df3cb96e5c3a83f1959e6bd (patch) | |
tree | 143c82f45f9c2b483dd43b27d2b609a66e371072 | |
parent | 846cc90c3d0e80a720a621f5776eeedc537485b1 (diff) | |
download | efl-923d01d7ed1555902df3cb96e5c3a83f1959e6bd.tar.gz |
evas/wayland_egl: (GL thread) Moved eng_window_new() to the GL worker thread
For just secure for more safety with strange driver issues.
Change-Id: I5b61b06ec759eeb00742adbd8747fbf24f8dc219
Conflicts:
src/modules/evas/engines/wayland_egl/evas_wl_main.c
-rw-r--r-- | src/modules/evas/engines/wayland_egl/evas_wl_main.c | 72 |
1 files changed, 71 insertions, 1 deletions
diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c index fb4e26e141..380699440b 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -9,7 +9,7 @@ static struct wl_display *display = NULL; static int win_count = 0; Outbuf * -eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode) +_orig_eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode) { Outbuf *gw; int context_attrs[3]; @@ -185,6 +185,76 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, Render_Engine_Swap return gw; } +typedef struct +{ + Outbuf *return_value; + Evas *evas; + Evas_Engine_Info_Wayland *einfo; + int w; + int h; + Render_Engine_Swap_Mode swap_mode; + int depth_bits; + int stencil_bits; + int msaa_bits; +} Evas_Thread_Command_eng_window_new; + +static void +_gl_thread_eng_window_new(void *data) +{ + Evas_Thread_Command_eng_window_new *thread_param = + (Evas_Thread_Command_eng_window_new *)data; + + evas_gl_thread_begin(); + + thread_param->return_value = _orig_eng_window_new(thread_param->evas, + thread_param->einfo, + thread_param->w, + thread_param->h, + thread_param->swap_mode, + thread_param->depth_bits, + thread_param->stencil_bits, + thread_param->msaa_bits); + + evas_gl_thread_end(); +} + +Outbuf * +eng_window_new(Evas *evas, Evas_Engine_Info_Wayland_Egl *einfo, int w, int h, Render_Engine_Swap_Mode swap_mode, + int depth_bits, int stencil_bits, int msaa_bits) +{ + /* eng_window_new() is moved into the worker thread that minimizes driver issue with EGL use*/ + if (!evas_gl_thread_enabled()) + { + return _orig_eng_window_new(evas, + einfo, + w, + h, + swap_mode, + depth_bits, + stencil_bits, + msaa_bits); + } + + Evas_Thread_Command_eng_window_new thread_param_local; + Evas_Thread_Command_eng_window_new *thread_param = &thread_param_local; + thread_param->evas = evas; + thread_param->einfo = einfo; + thread_param->w = w; + thread_param->h = h; + thread_param->swap_mode = swap_mode; + thread_param->depth_bits = depth_bits; + thread_param->stencil_bits = stencil_bits; + thread_param->msaa_bits = msaa_bits; + + evas_gl_thread_cmd_enqueue(EVAS_GL_THREAD_TYPE_GL, + _gl_thread_eng_window_new, + thread_param, + EVAS_GL_THREAD_MODE_FINISH); + + return thread_param->return_value; + +} + void eng_window_free(Outbuf *gw) { |