From 5811b0b88a6e0203fb6816e144fb6e699d0ad701 Mon Sep 17 00:00:00 2001 From: Joogab Yun Date: Wed, 6 Sep 2017 15:01:16 +0900 Subject: [PATCH] [evas_gl_x11] fixed build error Change-Id: I4e6da22cf88cf93d6531df0353b34651e4ee0adf --- src/modules/evas/engines/gl_x11/evas_engine.c | 14 ++++++++------ src/modules/evas/engines/gl_x11/evas_engine.h | 17 +++++++++++++++-- src/modules/evas/engines/gl_x11/evas_x_main.c | 4 ++-- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 1b90ca5..26d8ae4 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -87,6 +87,8 @@ unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const E unsigned int (*glsym_eglSetDamageRegion) (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d) = NULL; unsigned int (*glsym_eglQueryWaylandBufferWL)(EGLDisplay a, /*struct wl_resource */void *b, EGLint c, EGLint *d) = NULL; +void (*glsym_evas_gl_common_surface_cache_dump)(void) = NULL; + #else typedef XID (*glsym_func_xid) (); @@ -188,11 +190,11 @@ evas_eglGetCurrentContext(GL_X11_Context_Type type) EGLSurface evas_eglGetCurrentSurface(GL_X11_Context_Type type, EGLint readdraw) { - if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled()) + if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_GL)) { return GL_TH(eglGetCurrentSurface, readdraw); } - else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_evgl_thread_enabled()) + else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_EVGL)) { return EVGL_TH(eglGetCurrentSurface, readdraw); } @@ -208,11 +210,11 @@ evas_eglGetCurrentSurface(GL_X11_Context_Type type, EGLint readdraw) EGLDisplay evas_eglGetCurrentDisplay(GL_X11_Context_Type type) { - if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled()) + if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_GL)) { return GL_TH(eglGetCurrentDisplay); } - else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_evgl_thread_enabled()) + else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_EVGL)) { return EVGL_TH(eglGetCurrentDisplay); } @@ -228,11 +230,11 @@ evas_eglGetCurrentDisplay(GL_X11_Context_Type type) EGLBoolean evas_eglMakeCurrent(GL_X11_Context_Type type, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) { - if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled()) + if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_GL)) { return GL_TH(eglMakeCurrent, dpy, draw, read, ctx); } - else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_evgl_thread_enabled()) + else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_EVGL)) { return EVGL_TH(eglMakeCurrent, dpy, draw, read, ctx); } diff --git a/src/modules/evas/engines/gl_x11/evas_engine.h b/src/modules/evas/engines/gl_x11/evas_engine.h index bde5172..2a83cb9 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.h +++ b/src/modules/evas/engines/gl_x11/evas_engine.h @@ -12,6 +12,7 @@ #ifdef GL_GLES # define SUPPORT_X11 1 # include +# include # include # include # include @@ -214,8 +215,20 @@ _re_wincheck(Outbuf *ob) return 0; } -#ifndef GL_GLES -Eina_Bool __glXMakeContextCurrent(Display *disp, GLXDrawable glxwin, +typedef enum +{ + GL_X11_CONTEXT_TYPE_EVAS = 0, + GL_X11_CONTEXT_TYPE_EVGL = 1 +} GL_X11_Context_Type; + + +#ifdef GL_GLES +EGLBoolean evas_eglMakeCurrent(GL_X11_Context_Type type, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); +EGLContext evas_eglGetCurrentContext(GL_X11_Context_Type type); +EGLSurface evas_eglGetCurrentSurface(GL_X11_Context_Type type, EGLint readdraw); +EGLDisplay evas_eglGetCurrentDisplay(GL_X11_Context_Type type); +#else +Eina_Bool __glXMakeContextCurrent(GL_X11_Context_Type type, Display *disp, GLXDrawable glxwin, GLXContext context); #endif diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c index a86be49..1384259 100644 --- a/src/modules/evas/engines/gl_x11/evas_x_main.c +++ b/src/modules/evas/engines/gl_x11/evas_x_main.c @@ -135,7 +135,7 @@ __glXMakeContextCurrent(GL_X11_Context_Type type, Display *disp, GLXDrawable glx } return EINA_FALSE; #else - if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled()) + if (type == GL_X11_CONTEXT_TYPE_EVAS && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_GL)) { void *ret = GL_TH(glXMakeContextCurrentASYNC_begin, disp, glxwin, glxwin, context); if (!ret) ERR("NO ASYNC RETURN!"); @@ -143,7 +143,7 @@ __glXMakeContextCurrent(GL_X11_Context_Type type, Display *disp, GLXDrawable glx ERR("GOOD ASYNC RETURN TRUE!"); return EINA_TRUE; } - else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_evgl_thread_enabled()) + else if (type == GL_X11_CONTEXT_TYPE_EVGL && evas_gl_thread_enabled(EVAS_GL_THREAD_TYPE_EVGL)) { if (!EVGL_TH(glXMakeContextCurrent, disp, glxwin, glxwin, context)) return EINA_FALSE; return EINA_TRUE; -- 2.7.4