Evas GL: Fix linking to 'context_restore_set'

There was a terribly complex mechanism to call this function
from the gl_x11 engine to gl_common (evas gl core)... and it
simply didn't work because the function pointer would be NULL.
This commit is contained in:
Jean-Philippe Andre 2015-11-06 15:28:12 +09:00
parent c22c25c9ef
commit b80d7fa302
6 changed files with 14 additions and 8 deletions

View File

@ -872,6 +872,5 @@ _comp_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt
extern Eina_Bool _need_context_restore;
extern void _context_restore(void);
EAPI void evas_gl_context_restore_set(Eina_Bool enable);
#endif

View File

@ -2954,8 +2954,8 @@ evgl_direct_partial_render_end()
}
}
void
evas_gl_context_restore_set(Eina_Bool enable)
EAPI void
evas_gl_common_context_restore_set(Eina_Bool enable)
{
_need_context_restore = enable;
}

View File

@ -47,6 +47,7 @@ EAPI void evgl_engine_shutdown(void *eng_data);
EAPI void *evgl_native_surface_buffer_get(EVGL_Surface *sfc, Eina_Bool *is_egl_image);
EAPI int evgl_native_surface_yinvert_get(EVGL_Surface *sfc);
EAPI void *evgl_current_native_context_get(EVGL_Context *ctx);
EAPI void evas_gl_common_context_restore_set(Eina_Bool);
typedef void (*EVGL_Engine_Call)(void *eng_data);
typedef void *(*EVGL_Native_Surface_Call)(void *sfc, Eina_Bool *is_egl_image);

View File

@ -75,7 +75,6 @@ glsym_func_void glsym_evas_gl_common_shaders_flush = NULL;
glsym_func_void glsym_evas_gl_common_error_set = NULL;
glsym_func_int glsym_evas_gl_common_error_get = NULL;
glsym_func_void_ptr glsym_evas_gl_common_current_context_get = NULL;
void (*glsym_evas_gl_context_restore_set) (Eina_Bool enable) = NULL;
#ifdef GL_GLES
@ -1233,7 +1232,6 @@ gl_symbols(void)
LINK2GENERIC(evas_gl_common_error_get);
LINK2GENERIC(evas_gl_common_error_set);
LINK2GENERIC(evas_gl_common_current_context_get);
LINK2GENERIC(evas_gl_context_restore_set);
LINK2GENERIC(evas_gl_common_shaders_flush);
#ifdef GL_GLES

View File

@ -219,6 +219,4 @@ Eina_Bool __glXMakeContextCurrent(Display *disp, GLXDrawable glxwin,
GLXContext context);
#endif
extern void (*glsym_evas_gl_context_restore_set) (Eina_Bool enable);
#endif

View File

@ -1,11 +1,15 @@
#include "evas_engine.h"
#include "../gl_common/evas_gl_define.h"
#include <dlfcn.h>
# define SET_RESTORE_CONTEXT() do { if (glsym_evas_gl_context_restore_set) glsym_evas_gl_context_restore_set(EINA_TRUE); } while(0)
# define SET_RESTORE_CONTEXT() do { if (glsym_evas_gl_common_context_restore_set) glsym_evas_gl_common_context_restore_set(EINA_TRUE); } while(0)
static Eina_TLS _outbuf_key = 0;
static Eina_TLS _context_key = 0;
typedef void (*glsym_func_void) ();
glsym_func_void glsym_evas_gl_common_context_restore_set = NULL;
#ifdef GL_GLES
typedef EGLContext GLContext;
typedef EGLConfig GLConfig;
@ -38,6 +42,12 @@ eng_init(void)
if (initted)
return EINA_TRUE;
#define LINK2GENERIC(sym) \
glsym_##sym = dlsym(RTLD_DEFAULT, #sym); \
if (!glsym_##sym) ERR("Could not find function '%s'", #sym);
LINK2GENERIC(evas_gl_common_context_restore_set);
// FIXME: These resources are never released
if (!eina_tls_new(&_outbuf_key))
goto error;