aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-14 21:35:09 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-15 16:20:53 +0900
commit9c69d4c1e1baeb9f7f2571321b01a41c7b310a51 (patch)
tree3e89009358faf4108bc6fd5f1e3102bed0f821cb
parentEvas GL: Don't call eglMakeCurrent if already null (diff)
downloadefl-9c69d4c1e1baeb9f7f2571321b01a41c7b310a51.tar.gz
Evas GL: Error out on surfaceless make_current with OSMesa
While OSMesa may support surfaceless contexts, we don't support them yet in the SW engine. Instead of switching to NULL, NULL, let's error out and do nothing instead.
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 721c4eef82..70023787ff 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -123,7 +123,6 @@ typedef OSMesaContext (*glsym_func_osm_ctx) ();
static Evas_GL_API gl_funcs;
static void *gl_lib_handle;
static int gl_lib_is_gles = 0;
-static Evas_GL_API gl_funcs;
static Eina_Bool _tls_init = EINA_FALSE;
static Eina_TLS gl_current_ctx_key = 0;
@@ -3087,6 +3086,12 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context)
_tls_check();
+ if ((!sfc) ^ (!ctx))
+ {
+ ERR("Evas GL on SW engine does not support surfaceless contexts.");
+ return 0;
+ }
+
// Unset surface/context
if ((!sfc) || (!ctx))
{
@@ -3101,15 +3106,15 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context)
if (!ctx->initialized)
{
if (ctx->share_ctx)
- share_ctx = ctx->share_ctx->context;
+ share_ctx = ctx->share_ctx->context;
else
- share_ctx = NULL;
+ share_ctx = NULL;
- ctx->context = _sym_OSMesaCreateContextExt(sfc->internal_fmt,
- sfc->depth_bits,
- sfc->stencil_bits,
- 0,
- share_ctx);
+ ctx->context = _sym_OSMesaCreateContextExt(sfc->internal_fmt,
+ sfc->depth_bits,
+ sfc->stencil_bits,
+ 0,
+ share_ctx);
if (!ctx->context)
{
ERR("Error initializing context.");
@@ -4939,7 +4944,7 @@ evgl_glGetString(GLenum name)
static void
override_gl_apis(Evas_GL_API *api)
{
-
+ memset(&gl_funcs, 0, sizeof(gl_funcs));
api->version = EVAS_GL_API_VERSION;
#define ORD(f) EVAS_API_OVERRIDE(f, api, _sym_)