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)
downloadefl-8942c0c29bc0f58c8821136c03b6cbff9b5b13c8.tar.gz
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 68ac0ec005..5b539e4008 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)
surf = NULL;
}
-// Internal function - called from evas_gl_core.c
+// Internal functions - called from evas_gl_core.c
static void *
evas_gl_native_context_get(void *context)
{
@@ -335,6 +335,17 @@ evas_gl_native_context_get(void *context)
return ctx->data;
}
+static void *
+evas_gl_engine_data_get(void *evgl)
+{
+ Evas_GL *evasgl = evgl;
+
+ if (!evasgl) return NULL;
+ if (!evasgl->evas) return NULL;
+
+ return evasgl->evas->engine.data.output;
+}
+
EAPI Evas_GL_Context *
evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx,
Evas_GL_Context_Version version)
@@ -367,7 +378,7 @@ evas_gl_context_version_create(Evas_GL *evas_gl, Evas_GL_Context *share_ctx,
ctx->version = version;
ctx->data = evas_gl->evas->engine.func->gl_context_create
(evas_gl->evas->engine.data.output, share_ctx ? share_ctx->data : NULL,
- version, &evas_gl_native_context_get);
+ version, &evas_gl_native_context_get, &evas_gl_engine_data_get);
// Set a few variables
if (!ctx->data)