summaryrefslogtreecommitdiff
path: root/src
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 /src
parent079436d4f190faed842dce14276231a0907cba2a (diff)
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.
Diffstat (limited to 'src')
-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 721c4ee..7002378 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) ();
123static Evas_GL_API gl_funcs; 123static Evas_GL_API gl_funcs;
124static void *gl_lib_handle; 124static void *gl_lib_handle;
125static int gl_lib_is_gles = 0; 125static int gl_lib_is_gles = 0;
126static Evas_GL_API gl_funcs;
127 126
128static Eina_Bool _tls_init = EINA_FALSE; 127static Eina_Bool _tls_init = EINA_FALSE;
129static Eina_TLS gl_current_ctx_key = 0; 128static Eina_TLS gl_current_ctx_key = 0;
@@ -3087,6 +3086,12 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context)
3087 3086
3088 _tls_check(); 3087 _tls_check();
3089 3088
3089 if ((!sfc) ^ (!ctx))
3090 {
3091 ERR("Evas GL on SW engine does not support surfaceless contexts.");
3092 return 0;
3093 }
3094
3090 // Unset surface/context 3095 // Unset surface/context
3091 if ((!sfc) || (!ctx)) 3096 if ((!sfc) || (!ctx))
3092 { 3097 {
@@ -3101,15 +3106,15 @@ eng_gl_make_current(void *data EINA_UNUSED, void *surface, void *context)
3101 if (!ctx->initialized) 3106 if (!ctx->initialized)
3102 { 3107 {
3103 if (ctx->share_ctx) 3108 if (ctx->share_ctx)
3104 share_ctx = ctx->share_ctx->context; 3109 share_ctx = ctx->share_ctx->context;
3105 else 3110 else
3106 share_ctx = NULL; 3111 share_ctx = NULL;
3107 3112
3108 ctx->context = _sym_OSMesaCreateContextExt(sfc->internal_fmt, 3113 ctx->context = _sym_OSMesaCreateContextExt(sfc->internal_fmt,
3109 sfc->depth_bits, 3114 sfc->depth_bits,
3110 sfc->stencil_bits, 3115 sfc->stencil_bits,
3111 0, 3116 0,
3112 share_ctx); 3117 share_ctx);
3113 if (!ctx->context) 3118 if (!ctx->context)
3114 { 3119 {
3115 ERR("Error initializing context."); 3120 ERR("Error initializing context.");
@@ -4939,7 +4944,7 @@ evgl_glGetString(GLenum name)
4939static void 4944static void
4940override_gl_apis(Evas_GL_API *api) 4945override_gl_apis(Evas_GL_API *api)
4941{ 4946{
4942 4947 memset(&gl_funcs, 0, sizeof(gl_funcs));
4943 api->version = EVAS_GL_API_VERSION; 4948 api->version = EVAS_GL_API_VERSION;
4944 4949
4945#define ORD(f) EVAS_API_OVERRIDE(f, api, _sym_) 4950#define ORD(f) EVAS_API_OVERRIDE(f, api, _sym_)