diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-07-16 22:25:36 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-07-17 14:47:42 +0900 |
commit | 8942c0c29bc0f58c8821136c03b6cbff9b5b13c8 (patch) | |
tree | e68d6f050e4059fb71ad9531a950b2eac83236cd /src/lib | |
parent | 51b097c014c77c36f708d3371a42e2045e003ba2 (diff) | |
download | efl-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')
-rw-r--r-- | src/lib/evas/canvas/evas_gl.c | 15 | ||||
-rw-r--r-- | src/lib/evas/include/evas_private.h | 2 |
2 files changed, 14 insertions, 3 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) diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index ecb8b8c88e..2e54ab046d 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1370,7 +1370,7 @@ struct _Evas_Func void *(*gl_surface_create) (void *data, void *config, int w, int h); void *(*gl_pbuffer_surface_create) (void *data, void *config, int w, int h, int const *attrib_list); int (*gl_surface_destroy) (void *data, void *surface); - void *(*gl_context_create) (void *data, void *share_context, int version, void *(*native_context_get)(void *ctx)); + void *(*gl_context_create) (void *data, void *share_context, int version, void *(*native_context_get)(void *ctx), void *(*engine_data_get)(void *evasgl)); int (*gl_context_destroy) (void *data, void *context); int (*gl_make_current) (void *data, void *surface, void *context); const char *(*gl_string_query) (void *data, int name); |