From ddbd63e37d37df219808b2ea62b64b8714ce1954 Mon Sep 17 00:00:00 2001 From: Daekwang Ryu Date: Tue, 12 Dec 2017 13:54:46 +0900 Subject: [PATCH] evas_gl: fix evas_gl_current_context_get() evas_gl_current_context_get() function should return the context of evas_gl_common_current_context_get() becuase CONTEXT_RESTORE feature was added. CONTEXT_RESTORE makes app call evas_gl_make_current() only once without evas_gl context switching. Change-Id: Ic1807436691ce714ee7f8dc231d7215db37c2959 --- src/modules/evas/engines/wayland_egl/evas_engine.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c index 59bae45..77df7dd 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -1120,9 +1120,18 @@ static void * eng_gl_current_context_get(void *data EINA_UNUSED) { EVGL_Context *ctx; + EVGLNative_Context context; ctx = glsym_evas_gl_common_current_context_get(); - return ctx; + if (!ctx) + return NULL; + + context = glsym_evgl_current_native_context_get(ctx); + + if (evas_eglGetCurrentContext() == context) + return ctx; + + return NULL; } static int -- 2.7.4