diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2014-11-18 18:37:59 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2014-11-18 18:46:58 +0900 |
commit | 1608d3039076a0c6072c079a6b6ea8368b4f5b4a (patch) | |
tree | bc3db248b0e0aa06900c4ca0b074da0cf923bfb0 | |
parent | f663980111740112d41fbe86dbe56fabca5a9172 (diff) | |
download | efl-1608d3039076a0c6072c079a6b6ea8368b4f5b4a.tar.gz |
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.c | 10 |
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) dbg = evgl_engine->api_debug_mode; if (dbg) DBG("(eng = %p, sfc = %p, ctx = %p), rsc = %p", eng_data, sfc, ctx, rsc); - if (!rsc) return 0; + if (!rsc) + { + DBG("Creating new TLS for this thread: %lu", eina_thread_self()); + rsc = _evgl_tls_resource_create(eng_data); + if (!rsc) return 0; + } // Unset if ((!sfc) && (!ctx)) @@ -2052,7 +2057,6 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) evgl_direct_partial_render_end(); } - // FIXME: This code path does not properly set the underlying TLS vars. if (dbg) DBG("Calling make_current(NULL, NULL)"); if (!evgl_engine->funcs->make_current(eng_data, NULL, NULL, 0)) { @@ -2060,7 +2064,7 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx) return 0; } - //FIXME!!! + // FIXME -- What is this "FIXME" about? if (rsc->current_ctx) { rsc->current_ctx->current_sfc = NULL; |