summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_gl.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-07-16 22:25:36 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-07-17 14:47:42 +0900
commit8942c0c29bc0f58c8821136c03b6cbff9b5b13c8 (patch)
treee68d6f050e4059fb71ad9531a950b2eac83236cd /src/lib/evas/canvas/evas_gl.c
parent51b097c014c77c36f708d3371a42e2045e003ba2 (diff)
Evas GL: Fix sync, wlbuffer and image egl ext functions
Before this patch, those EGL/EvasGL functions can not work without a current context. But EGL does not require any current context for those to work, or at least, this should be left to the driver to decide. Evas GL was only able to get a pointer to the display if a context was current. The display pointer should be infered from Evas_GL unless we can find a current display. EGL does not require a context to be current in most of these function calls. This should bring evasgl a little bit closer to EGL in terms of behaviour (those are EGL-only extensions, btw). Thanks @spacegrapher for the quick review @fix
Diffstat (limited to 'src/lib/evas/canvas/evas_gl.c')
-rw-r--r--src/lib/evas/canvas/evas_gl.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_gl.c b/src/lib/evas/canvas/evas_gl.c
index 68ac0ec..5b539e4 100644
--- a/src/lib/evas/canvas/evas_gl.c
+++ b/src/lib/evas/canvas/evas_gl.c
@@ -326,7 +326,7 @@ evas_gl_surface_destroy(Evas_GL *evas_gl, Evas_GL_Surface *surf)
326 surf = NULL; 326 surf = NULL;
327} 327}
328 328
329// Internal function - called from evas_gl_core.c 329// Internal functions - called from evas_gl_core.c
330static void * 330static void *
331evas_gl_native_context_get(void *context) 331evas_gl_native_context_get(void *context)
332{ 332{
@@ -335,6 +335,17 @@ evas_gl_native_context_get(void *context)
335 return ctx->data; 335 return ctx->data;
336} 336}
337 337
338static void *
339evas_gl_engine_data_get(void *evgl)
340{
341 Evas_GL *evasgl = evgl;
342
343 if (!evasgl) return NULL;
344 if (!evasgl->evas) return NULL;
345
346 return evasgl->evas->engine.data.output;
347}
348
338EAPI Evas_GL_Context * 349EAPI Evas_GL_Context *
339evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx, 350evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx,
340 Evas_GL_Context_Version version) 351 Evas_GL_Context_Version version)
@@ -367,7 +378,7 @@ evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx,
367 ctx->version = version; 378 ctx->version = version;
368 ctx->data = evas_gl->evas->engine.func->gl_context_create 379 ctx->data = evas_gl->evas->engine.func->gl_context_create
369 (evas_gl->evas->engine.data.output, share_ctx ? share_ctx->data : NULL, 380 (evas_gl->evas->engine.data.output, share_ctx ? share_ctx->data : NULL,
370 version, &evas_gl_native_context_get); 381 version, &evas_gl_native_context_get, &evas_gl_engine_data_get);
371 382
372 // Set a few variables 383 // Set a few variables
373 if (!ctx->data) 384 if (!ctx->data)