summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-11-18 18:37:59 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-11-18 18:46:58 +0900
commit1608d3039076a0c6072c079a6b6ea8368b4f5b4a (patch)
treebc3db248b0e0aa06900c4ca0b074da0cf923bfb0
parentf663980111740112d41fbe86dbe56fabca5a9172 (diff)
Evas GL: Create TLS during make_current if there isn't any
Apps would crash if they call make current without creating a surface in the same thread. I don't see a good reason why we should have this a limitation.
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c
index 81bc3b2103..adc027d8c9 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -2041,7 +2041,12 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2041 dbg = evgl_engine->api_debug_mode; 2041 dbg = evgl_engine->api_debug_mode;
2042 if (dbg) DBG("(eng = %p, sfc = %p, ctx = %p), rsc = %p", eng_data, sfc, ctx, rsc); 2042 if (dbg) DBG("(eng = %p, sfc = %p, ctx = %p), rsc = %p", eng_data, sfc, ctx, rsc);
2043 2043
2044 if (!rsc) return 0; 2044 if (!rsc)
2045 {
2046 DBG("Creating new TLS for this thread: %lu", eina_thread_self());
2047 rsc = _evgl_tls_resource_create(eng_data);
2048 if (!rsc) return 0;
2049 }
2045 2050
2046 // Unset 2051 // Unset
2047 if ((!sfc) && (!ctx)) 2052 if ((!sfc) && (!ctx))
@@ -2052,7 +2057,6 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2052 evgl_direct_partial_render_end(); 2057 evgl_direct_partial_render_end();
2053 } 2058 }
2054 2059
2055 // FIXME: This code path does not properly set the underlying TLS vars.
2056 if (dbg) DBG("Calling make_current(NULL, NULL)"); 2060 if (dbg) DBG("Calling make_current(NULL, NULL)");
2057 if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0)) 2061 if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0))
2058 { 2062 {
@@ -2060,7 +2064,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2060 return 0; 2064 return 0;
2061 } 2065 }
2062 2066
2063 //FIXME!!! 2067 // FIXME -- What is this "FIXME" about?
2064 if (rsc->current_ctx) 2068 if (rsc->current_ctx)
2065 { 2069 {
2066 rsc->current_ctx->current_sfc = NULL; 2070 rsc->current_ctx->current_sfc = NULL;