Evas GL: Restore current context to evas gl context when the backend has taken over

Summary:
When Evas GL apis are called outside of on pixels callback,
evas gl backend context may have been made current, and Evas GL will
render into a wrong context.
So here we provide context restore mechanism of keeping track of
currently bound context and calling make current when needed.
@feature

Test Plan: Run Evas GL test cases

Reviewers: jpeg, cedric

Subscribers: mythri, mer.kim, wonsik, cedric

Differential Revision: https://phab.enlightenment.org/D2956
This commit is contained in:
Dongyeon Kim 2015-08-18 17:35:40 +09:00 committed by Jean-Philippe Andre
parent 8c8d254fbc
commit bea42e6a00
14 changed files with 1931 additions and 2802 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,143 @@
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glBindFramebuffer, (GLenum target, GLuint framebuffer), (target, framebuffer))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glClearDepthf, (GLclampf depth), (depth))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glDepthRangef, (GLclampf zNear, GLclampf zFar), (zNear, zFar))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glGetShaderPrecisionFormat, (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision), (shadertype, precisiontype, range, precision))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glShaderBinary, (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length), (n, shaders, binaryformat, binary, length))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glReleaseShaderCompiler, (void), ())
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glClearColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red, green, blue, alpha))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glClear, (GLbitfield mask), (mask))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glEnable, (GLenum cap), (cap))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glDisable, (GLenum cap), (cap))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glGetIntegerv, (GLenum pname, GLint* params), (pname, params))
_EVASGL_FUNCTION_PRIVATE_BEGIN(const GLubyte *, glGetString, (GLenum name), (name))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glReadPixels, (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels), (x, y, width, height, format, type, pixels))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glScissor, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height))
_EVASGL_FUNCTION_PRIVATE_BEGIN(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height), (x, y, width, height))
_EVASGL_FUNCTION_BEGIN(void, glActiveTexture, (GLenum texture), (texture))
_EVASGL_FUNCTION_BEGIN(void, glAttachShader, (GLuint program, GLuint shader), (program, shader))
_EVASGL_FUNCTION_BEGIN(void, glBindAttribLocation, (GLuint program, GLuint index, const char* name), (program, index, name))
_EVASGL_FUNCTION_BEGIN(void, glBindBuffer, (GLenum target, GLuint buffer), (target, buffer))
_EVASGL_FUNCTION_BEGIN(void, glBindRenderbuffer, (GLenum target, GLuint renderbuffer), (target, renderbuffer))
_EVASGL_FUNCTION_BEGIN(void, glBindTexture, (GLenum target, GLuint texture), (target, texture))
_EVASGL_FUNCTION_BEGIN(void, glBlendColor, (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha), (red, green, blue, alpha))
_EVASGL_FUNCTION_BEGIN(void, glBlendEquation, ( GLenum mode ), (mode))
_EVASGL_FUNCTION_BEGIN(void, glBlendEquationSeparate, (GLenum modeRGB, GLenum modeAlpha), (modeRGB, modeAlpha))
_EVASGL_FUNCTION_BEGIN(void, glBlendFunc, (GLenum sfactor, GLenum dfactor), (sfactor, dfactor))
_EVASGL_FUNCTION_BEGIN(void, glBlendFuncSeparate, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha), (srcRGB, dstRGB, srcAlpha, dstAlpha))
_EVASGL_FUNCTION_BEGIN(void, glBufferData, (GLenum target, GLsizeiptr size, const void* data, GLenum usage), (target, size, data, usage))
_EVASGL_FUNCTION_BEGIN(void, glBufferSubData, (GLenum target, GLintptr offset, GLsizeiptr size, const void* data), (target, offset, size, data))
_EVASGL_FUNCTION_BEGIN(GLenum, glCheckFramebufferStatus, (GLenum target), (target))
_EVASGL_FUNCTION_BEGIN(void, glClearStencil, (GLint s), (s))
_EVASGL_FUNCTION_BEGIN(void, glColorMask, (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha), (red, green, blue, alpha))
_EVASGL_FUNCTION_BEGIN(void, glCompileShader, (GLuint shader), (shader))
_EVASGL_FUNCTION_BEGIN(void, glCompressedTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data), (target, level, internalformat, width, height, border, imageSize, data))
_EVASGL_FUNCTION_BEGIN(void, glCompressedTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data), (target, level, xoffset, yoffset, width, height, format, imageSize, data))
_EVASGL_FUNCTION_BEGIN(void, glCopyTexImage2D, (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border), (target, level, internalformat, x, y, width, height, border))
_EVASGL_FUNCTION_BEGIN(void, glCopyTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, x, y, width, height))
_EVASGL_FUNCTION_BEGIN(GLuint, glCreateProgram, (void), ())
_EVASGL_FUNCTION_BEGIN(GLuint, glCreateShader, (GLenum type), (type))
_EVASGL_FUNCTION_BEGIN(void, glCullFace, (GLenum mode), (mode))
_EVASGL_FUNCTION_BEGIN(void, glDeleteBuffers, (GLsizei n, const GLuint* buffers), (n, buffers))
_EVASGL_FUNCTION_BEGIN(void, glDeleteFramebuffers, (GLsizei n, const GLuint* framebuffers), (n, framebuffers))
_EVASGL_FUNCTION_BEGIN(void, glDeleteProgram, (GLuint program), (program))
_EVASGL_FUNCTION_BEGIN(void, glDeleteRenderbuffers, (GLsizei n, const GLuint* renderbuffers), (n, renderbuffers))
_EVASGL_FUNCTION_BEGIN(void, glDeleteShader, (GLuint shader), (shader))
_EVASGL_FUNCTION_BEGIN(void, glDeleteTextures, (GLsizei n, const GLuint* textures), (n, textures))
_EVASGL_FUNCTION_BEGIN(void, glDepthFunc, (GLenum func), (func))
_EVASGL_FUNCTION_BEGIN(void, glDepthMask, (GLboolean flag), (flag))
_EVASGL_FUNCTION_BEGIN(void, glDetachShader, (GLuint program, GLuint shader), (program, shader))
_EVASGL_FUNCTION_BEGIN(void, glDisableVertexAttribArray, (GLuint index), (index))
_EVASGL_FUNCTION_BEGIN(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count), (mode, first, count))
_EVASGL_FUNCTION_BEGIN(void, glDrawElements, (GLenum mode, GLsizei count, GLenum type, const void* indices), (mode, count, type, indices))
_EVASGL_FUNCTION_BEGIN(void, glEnableVertexAttribArray, (GLuint index), (index))
_EVASGL_FUNCTION_BEGIN(void, glFinish, (void), ())
_EVASGL_FUNCTION_BEGIN(void, glFlush, (void), ())
_EVASGL_FUNCTION_BEGIN(void, glFramebufferRenderbuffer, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer), (target, attachment, renderbuffertarget, renderbuffer))
_EVASGL_FUNCTION_BEGIN(void, glFramebufferTexture2D, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level), (target, attachment, textarget, texture, level))
_EVASGL_FUNCTION_BEGIN(void, glFrontFace, (GLenum mode), (mode))
_EVASGL_FUNCTION_BEGIN(void, glGenBuffers, (GLsizei n, GLuint* buffers), (n, buffers))
_EVASGL_FUNCTION_BEGIN(void, glGenerateMipmap, (GLenum target), (target))
_EVASGL_FUNCTION_BEGIN(void, glGenFramebuffers, (GLsizei n, GLuint* framebuffers), (n, framebuffers))
_EVASGL_FUNCTION_BEGIN(void, glGenRenderbuffers, (GLsizei n, GLuint* renderbuffers), (n, renderbuffers))
_EVASGL_FUNCTION_BEGIN(void, glGenTextures, (GLsizei n, GLuint* textures), (n, textures))
_EVASGL_FUNCTION_BEGIN(void, glGetActiveAttrib, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name), (program, index, bufsize, length, size, type, name))
_EVASGL_FUNCTION_BEGIN(void, glGetActiveUniform, (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name), (program, index, bufsize, length, size, type, name))
_EVASGL_FUNCTION_BEGIN(void, glGetAttachedShaders, (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders), (program, maxcount, count, shaders))
_EVASGL_FUNCTION_BEGIN(int, glGetAttribLocation, (GLuint program, const char* name), (program, name))
_EVASGL_FUNCTION_BEGIN(void, glGetBooleanv, (GLenum pname, GLboolean* params), (pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetBufferParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(GLenum, glGetError, (void), ())
_EVASGL_FUNCTION_BEGIN(void, glGetFloatv, (GLenum pname, GLfloat* params), (pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetFramebufferAttachmentParameteriv, (GLenum target, GLenum attachment, GLenum pname, GLint* params), (target, attachment, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetProgramiv, (GLuint program, GLenum pname, GLint* params), (program, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetProgramInfoLog, (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog), (program, bufsize, length, infolog))
_EVASGL_FUNCTION_BEGIN(void, glGetRenderbufferParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetShaderiv, (GLuint shader, GLenum pname, GLint* params), (shader, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetShaderInfoLog, (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog), (shader, bufsize, length, infolog))
_EVASGL_FUNCTION_BEGIN(void, glGetShaderSource, (GLuint shader, GLsizei bufsize, GLsizei* length, char* source), (shader, bufsize, length, source))
_EVASGL_FUNCTION_BEGIN(void, glGetTexParameterfv, (GLenum target, GLenum pname, GLfloat* params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetTexParameteriv, (GLenum target, GLenum pname, GLint* params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetUniformfv, (GLuint program, GLint location, GLfloat* params), (program, location, params))
_EVASGL_FUNCTION_BEGIN(void, glGetUniformiv, (GLuint program, GLint location, GLint* params), (program, location, params))
_EVASGL_FUNCTION_BEGIN(int, glGetUniformLocation, (GLuint program, const char* name), (program, name))
_EVASGL_FUNCTION_BEGIN(void, glGetVertexAttribfv, (GLuint index, GLenum pname, GLfloat* params), (index, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetVertexAttribiv, (GLuint index, GLenum pname, GLint* params), (index, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetVertexAttribPointerv, (GLuint index, GLenum pname, void** pointer), (index, pname, pointer))
_EVASGL_FUNCTION_BEGIN(void, glHint, (GLenum target, GLenum mode), (target, mode))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsBuffer, (GLuint buffer), (buffer))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsEnabled, (GLenum cap), (cap))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsFramebuffer, (GLuint framebuffer), (framebuffer))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsProgram, (GLuint program), (program))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsRenderbuffer, (GLuint renderbuffer), (renderbuffer))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsShader, (GLuint shader), (shader))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsTexture, (GLuint texture), (texture))
_EVASGL_FUNCTION_BEGIN(void, glLineWidth, (GLfloat width), (width))
_EVASGL_FUNCTION_BEGIN(void, glLinkProgram, (GLuint program), (program))
_EVASGL_FUNCTION_BEGIN(void, glPixelStorei, (GLenum pname, GLint param), (pname, param))
_EVASGL_FUNCTION_BEGIN(void, glPolygonOffset, (GLfloat factor, GLfloat units), (factor, units))
_EVASGL_FUNCTION_BEGIN(void, glRenderbufferStorage, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height), (target, internalformat, width, height))
_EVASGL_FUNCTION_BEGIN(void, glSampleCoverage, (GLclampf value, GLboolean invert), (value, invert))
_EVASGL_FUNCTION_BEGIN(void, glShaderSource, (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length), (shader, count, string, length))
_EVASGL_FUNCTION_BEGIN(void, glStencilFunc, (GLenum func, GLint ref, GLuint mask), (func, ref, mask))
_EVASGL_FUNCTION_BEGIN(void, glStencilFuncSeparate, (GLenum face, GLenum func, GLint ref, GLuint mask), (face, func, ref, mask))
_EVASGL_FUNCTION_BEGIN(void, glStencilMask, (GLuint mask), (mask))
_EVASGL_FUNCTION_BEGIN(void, glStencilMaskSeparate, (GLenum face, GLuint mask), (face, mask))
_EVASGL_FUNCTION_BEGIN(void, glStencilOp, (GLenum fail, GLenum zfail, GLenum zpass), (fail, zfail, zpass))
_EVASGL_FUNCTION_BEGIN(void, glStencilOpSeparate, (GLenum face, GLenum fail, GLenum zfail, GLenum zpass), (face, fail, zfail, zpass))
_EVASGL_FUNCTION_BEGIN(void, glTexImage2D, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels), (target, level, internalformat, width, height, border, format, type, pixels))
_EVASGL_FUNCTION_BEGIN(void, glTexParameterf, (GLenum target, GLenum pname, GLfloat param), (target, pname, param))
_EVASGL_FUNCTION_BEGIN(void, glTexParameterfv, (GLenum target, GLenum pname, const GLfloat* params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glTexParameteri, (GLenum target, GLenum pname, GLint param), (target, pname, param))
_EVASGL_FUNCTION_BEGIN(void, glTexParameteriv, (GLenum target, GLenum pname, const GLint* params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glTexSubImage2D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels), (target, level, xoffset, yoffset, width, height, format, type, pixels))
_EVASGL_FUNCTION_BEGIN(void, glUniform1f, (GLint location, GLfloat x), (location, x))
_EVASGL_FUNCTION_BEGIN(void, glUniform1fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniform1i, (GLint location, GLint x), (location, x))
_EVASGL_FUNCTION_BEGIN(void, glUniform1iv, (GLint location, GLsizei count, const GLint* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniform2f, (GLint location, GLfloat x, GLfloat y), (location, x, y))
_EVASGL_FUNCTION_BEGIN(void, glUniform2fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniform2i, (GLint location, GLint x, GLint y), (location, x, y))
_EVASGL_FUNCTION_BEGIN(void, glUniform2iv, (GLint location, GLsizei count, const GLint* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniform3f, (GLint location, GLfloat x, GLfloat y, GLfloat z), (location, x, y, z))
_EVASGL_FUNCTION_BEGIN(void, glUniform3fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniform3i, (GLint location, GLint x, GLint y, GLint z), (location, x, y, z))
_EVASGL_FUNCTION_BEGIN(void, glUniform3iv, (GLint location, GLsizei count, const GLint* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniform4f, (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (location, x, y, z, w))
_EVASGL_FUNCTION_BEGIN(void, glUniform4fv, (GLint location, GLsizei count, const GLfloat* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniform4i, (GLint location, GLint x, GLint y, GLint z, GLint w), (location, x, y, z, w))
_EVASGL_FUNCTION_BEGIN(void, glUniform4iv, (GLint location, GLsizei count, const GLint* v), (location, count, v))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUseProgram, (GLuint program), (program))
_EVASGL_FUNCTION_BEGIN(void, glValidateProgram, (GLuint program), (program))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib1f, (GLuint indx, GLfloat x), (indx, x))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib1fv, (GLuint indx, const GLfloat* values), (indx, values))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib2f, (GLuint indx, GLfloat x, GLfloat y), (indx, x, y))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib2fv, (GLuint indx, const GLfloat* values), (indx, values))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib3f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z), (indx, x, y, z))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib3fv, (GLuint indx, const GLfloat* values), (indx, values))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib4f, (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w), (indx, x, y, z, w))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttrib4fv, (GLuint indx, const GLfloat* values), (indx, values))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttribPointer, (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr), (indx, size, type, normalized, stride, ptr))

View File

@ -3,6 +3,8 @@
#include <dlfcn.h>
#define EVGL_FUNC_BEGIN() if (UNLIKELY(_need_context_restore)) _context_restore()
// list of egl extensions
#ifdef GL_GLES
static char *_egl_ext_string = NULL;
@ -40,11 +42,11 @@ struct wl_resource;
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
ret (*egl_ext_sym_##name) param = NULL; \
ret (*gl_ext_sym_##name) param = NULL; \
ret (*gles1_ext_sym_##name) param = NULL; \
ret (*gles3_ext_sym_##name) param = NULL;
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
ret (*egl_ext_sym_##name) param1 = NULL; \
ret (*gl_ext_sym_##name) param1 = NULL; \
ret (*gles1_ext_sym_##name) param1 = NULL; \
ret (*gles3_ext_sym_##name) param1 = NULL;
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@ -86,7 +88,7 @@ struct wl_resource;
int _gles1_ext_support_func_##name = 0; \
int _gles3_ext_support_func_##name = 0;
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@ -112,6 +114,7 @@ struct wl_resource;
#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
/////////////////////////////////////////////////////////////////////////////////////////////////////
#define EVGL_FUNC_BEGIN() if (UNLIKELY(_need_context_restore)) _context_restore()
// Evas extensions from EGL extensions
#ifdef GL_GLES
@ -200,7 +203,7 @@ _evgl_eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx,
}
static void *
evgl_evasglCreateImage(int target, void* buffer, const int *attrib_list)
_evgl_evasglCreateImage(int target, void* buffer, const int *attrib_list)
{
EGLDisplay dpy = EGLDISPLAY_GET(NULL);
EGLContext ctx = EGL_NO_CONTEXT;
@ -222,7 +225,7 @@ evgl_evasglCreateImage(int target, void* buffer, const int *attrib_list)
}
static void *
evgl_evasglCreateImageForContext(Evas_GL *evasgl, Evas_GL_Context *evasctx,
_evgl_evasglCreateImageForContext(Evas_GL *evasgl, Evas_GL_Context *evasctx,
int target, void* buffer, const int *attrib_list)
{
EGLDisplay dpy = EGLDISPLAY_GET(evasgl);
@ -240,7 +243,7 @@ evgl_evasglCreateImageForContext(Evas_GL *evasgl, Evas_GL_Context *evasctx,
}
static void
evgl_evasglDestroyImage(EvasGLImage image)
_evgl_evasglDestroyImage(EvasGLImage image)
{
EvasGLImage_EGL *img = image;
@ -249,7 +252,7 @@ evgl_evasglDestroyImage(EvasGLImage image)
}
static void
evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image)
_evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image)
{
EvasGLImage_EGL *img = image;
@ -257,7 +260,7 @@ evgl_glEvasGLImageTargetTexture2D(GLenum target, EvasGLImage image)
}
static void
evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image)
_evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image)
{
EvasGLImage_EGL *img = image;
@ -265,7 +268,7 @@ evgl_glEvasGLImageTargetRenderbufferStorage(GLenum target, EvasGLImage image)
}
static EvasGLSync
evgl_evasglCreateSync(Evas_GL *evas_gl,
_evgl_evasglCreateSync(Evas_GL *evas_gl,
unsigned int type, const int *attrib_list)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -274,7 +277,7 @@ evgl_evasglCreateSync(Evas_GL *evas_gl,
}
static Eina_Bool
evgl_evasglDestroySync(Evas_GL *evas_gl, EvasGLSync sync)
_evgl_evasglDestroySync(Evas_GL *evas_gl, EvasGLSync sync)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
if (!dpy) return EINA_FALSE;
@ -282,7 +285,7 @@ evgl_evasglDestroySync(Evas_GL *evas_gl, EvasGLSync sync)
}
static int
evgl_evasglClientWaitSync(Evas_GL *evas_gl,
_evgl_evasglClientWaitSync(Evas_GL *evas_gl,
EvasGLSync sync, int flags, EvasGLTime timeout)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -291,7 +294,7 @@ evgl_evasglClientWaitSync(Evas_GL *evas_gl,
}
static Eina_Bool
evgl_evasglSignalSync(Evas_GL *evas_gl,
_evgl_evasglSignalSync(Evas_GL *evas_gl,
EvasGLSync sync, unsigned mode)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -300,7 +303,7 @@ evgl_evasglSignalSync(Evas_GL *evas_gl,
}
static Eina_Bool
evgl_evasglGetSyncAttrib(Evas_GL *evas_gl,
_evgl_evasglGetSyncAttrib(Evas_GL *evas_gl,
EvasGLSync sync, int attribute, int *value)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -309,7 +312,7 @@ evgl_evasglGetSyncAttrib(Evas_GL *evas_gl,
}
static int
evgl_evasglWaitSync(Evas_GL *evas_gl,
_evgl_evasglWaitSync(Evas_GL *evas_gl,
EvasGLSync sync, int flags)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -318,7 +321,7 @@ evgl_evasglWaitSync(Evas_GL *evas_gl,
}
static Eina_Bool
evgl_evasglBindWaylandDisplay(Evas_GL *evas_gl,
_evgl_evasglBindWaylandDisplay(Evas_GL *evas_gl,
void *wl_display)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -327,7 +330,7 @@ evgl_evasglBindWaylandDisplay(Evas_GL *evas_gl,
}
static Eina_Bool
evgl_evasglUnbindWaylandDisplay(Evas_GL *evas_gl,
_evgl_evasglUnbindWaylandDisplay(Evas_GL *evas_gl,
void *wl_display)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -336,7 +339,7 @@ evgl_evasglUnbindWaylandDisplay(Evas_GL *evas_gl,
}
static Eina_Bool
evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl,
_evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl,
void *buffer, int attribute, int *value)
{
EGLDisplay dpy = EGLDISPLAY_GET(evas_gl);
@ -348,7 +351,7 @@ evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl,
#endif
static void
evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
_evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum* attachments)
{
EVGL_Resource *rsc;
EVGL_Context *ctx;
@ -407,8 +410,77 @@ evgl_glDiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum
}
}
//2.0 ext bodies
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_BEGIN(name)
#define _EVASGL_EXT_END()
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
static ret evgl_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC(name) param2; }
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_PRIVATE_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_DRVNAME_PRIVATE
#undef _EVASGL_EXT_DRVNAME_DESKTOP
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
#undef _EVASGL_EXT_FUNCTION_PRIVATE_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
//1.1 ext bodies
#define _EVASGL_EXT_CHECK_SUPPORT(name)
#define _EVASGL_EXT_DISCARD_SUPPORT()
#define _EVASGL_EXT_BEGIN(name)
#define _EVASGL_EXT_END()
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
static ret evgl_gles1_##name param1 { EVGL_FUNC_BEGIN(); return EXT_FUNC_GLES1(name) param2; }
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_PRIVATE_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
#include "evas_gl_api_ext_def.h"
#undef _EVASGL_EXT_CHECK_SUPPORT
#undef _EVASGL_EXT_DISCARD_SUPPORT
#undef _EVASGL_EXT_BEGIN
#undef _EVASGL_EXT_END
#undef _EVASGL_EXT_DRVNAME
#undef _EVASGL_EXT_DRVNAME_PRIVATE
#undef _EVASGL_EXT_DRVNAME_DESKTOP
#undef _EVASGL_EXT_FUNCTION_BEGIN
#undef _EVASGL_EXT_FUNCTION_END
#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
#undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN
#undef _EVASGL_EXT_FUNCTION_PRIVATE_END
#undef _EVASGL_EXT_FUNCTION_DRVFUNC
#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
// 0: not initialized,
// 1: GLESv2 initialized,
@ -463,9 +535,9 @@ evgl_api_egl_ext_init(void *getproc, const char *glueexts)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \
if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1;
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
{ \
ret (**drvfunc)param = &egl_ext_sym_##name; \
ret (**drvfunc)param1 = &egl_ext_sym_##name; \
if (*ext_support == 1) \
{
@ -544,7 +616,7 @@ evgl_api_egl_ext_init(void *getproc, const char *glueexts)
if (_curext_supported && _egl_ext_support_func_##name) \
_EVASGL_EXT_DRVNAME_PRINT(#name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@ -641,9 +713,9 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \
if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1;
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
{ \
ret (**drvfunc)param = &gl_ext_sym_##name; \
ret (**drvfunc)param1 = &gl_ext_sym_##name; \
if (*ext_support == 1) \
{
@ -723,7 +795,7 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
if (_curext_supported && _gl_ext_support_func_##name) \
_EVASGL_EXT_DRVNAME_PRINT(#name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@ -775,7 +847,7 @@ evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
return;
}
}
#define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, gl_ext_sym_)
#define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, evgl_)
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
@ -790,12 +862,12 @@ evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
ORD(name);
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_PRIVATE_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
@ -919,9 +991,9 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \
if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1;
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
{ \
ret (**drvfunc)param = &gles1_ext_sym_##name; \
ret (**drvfunc)param1 = &gles1_ext_sym_##name; \
if (*ext_support == 1) \
{
@ -1005,7 +1077,7 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
if (_curext_supported && _gles1_ext_support_func_##name) \
_EVASGL_EXT_DRVNAME_PRINT(#name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@ -1061,7 +1133,7 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
}
}
#define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, gles1_ext_sym_)
#define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, evgl_gles1_)
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
@ -1076,12 +1148,12 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
ORD(name);
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_PRIVATE_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
@ -1203,9 +1275,9 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \
if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1;
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
{ \
ret (**drvfunc)param = &gles3_ext_sym_##name; \
ret (**drvfunc)param1 = &gles3_ext_sym_##name; \
if (*ext_support == 1) \
{
@ -1284,7 +1356,7 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
if (_curext_supported && _gles3_ext_support_func_##name) \
_EVASGL_EXT_DRVNAME_PRINT(#name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@ -1341,7 +1413,7 @@ evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
}
}
#define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, gles3_ext_sym_)
#define ORD(f) EVAS_API_OVERRIDE(f, gl_funcs, evgl_)
/////////////////////////////////////////////////////////////////////////////////////////////////////
// Extension HEADER
@ -1356,12 +1428,12 @@ evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
ORD(name);
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_PRIVATE_END()
#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)

View File

@ -26,11 +26,11 @@
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
extern ret (*egl_ext_sym_##name) param; \
extern ret (*gl_ext_sym_##name) param; \
extern ret (*gles1_ext_sym_##name) param; \
extern ret (*gles3_ext_sym_##name) param;
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2) \
extern ret (*egl_ext_sym_##name) param1; \
extern ret (*gl_ext_sym_##name) param1; \
extern ret (*gles1_ext_sym_##name) param1; \
extern ret (*gles3_ext_sym_##name) param1;
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@ -72,7 +72,7 @@
#define _EVASGL_EXT_DRVNAME(name)
#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param1, param2)
#define _EVASGL_EXT_FUNCTION_END()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,104 @@
_EVASGL_FUNCTION_BEGIN(void, glBeginQuery, (GLenum target, GLuint id), (target, id))
_EVASGL_FUNCTION_BEGIN(void, glBeginTransformFeedback, (GLenum primitiveMode), (primitiveMode))
_EVASGL_FUNCTION_BEGIN(void, glBindBufferBase, (GLenum target, GLuint index, GLuint buffer), (target, index, buffer))
_EVASGL_FUNCTION_BEGIN(void, glBindBufferRange, (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size), (target, index, buffer, offset, size))
_EVASGL_FUNCTION_BEGIN(void, glBindSampler, (GLuint unit, GLuint sampler), (unit, sampler))
_EVASGL_FUNCTION_BEGIN(void, glBindTransformFeedback, (GLenum target, GLuint id), (target, id))
_EVASGL_FUNCTION_BEGIN(void, glBindVertexArray, (GLuint array), (array))
_EVASGL_FUNCTION_BEGIN(void, glBlitFramebuffer, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter), (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter))
_EVASGL_FUNCTION_BEGIN(void, glClearBufferfi, (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil), (buffer, drawBuffer, depth, stencil))
_EVASGL_FUNCTION_BEGIN(void, glClearBufferfv, (GLenum buffer, GLint drawBuffer, const GLfloat * value), (buffer, drawBuffer, value))
_EVASGL_FUNCTION_BEGIN(void, glClearBufferiv, (GLenum buffer, GLint drawBuffer, const GLint * value), (buffer, drawBuffer, value))
_EVASGL_FUNCTION_BEGIN(void, glClearBufferuiv, (GLenum buffer, GLint drawBuffer, const GLuint * value), (buffer, drawBuffer, value))
_EVASGL_FUNCTION_BEGIN(GLenum, glClientWaitSync, (GLsync sync, GLbitfield flags, EvasGLuint64 timeout), (sync, flags, timeout))
_EVASGL_FUNCTION_BEGIN(void, glCompressedTexImage3D, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data), (target, level, internalformat, width, height, depth, border, imageSize, data))
_EVASGL_FUNCTION_BEGIN(void, glCompressedTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data))
_EVASGL_FUNCTION_BEGIN(void, glCopyBufferSubData, (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size), (readtarget, writetarget, readoffset, writeoffset, size))
_EVASGL_FUNCTION_BEGIN(void, glCopyTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height), (target, level, xoffset, yoffset, zoffset, x, y, width, height))
_EVASGL_FUNCTION_BEGIN(void, glDeleteQueries, (GLsizei n, const GLuint * ids), (n, ids))
_EVASGL_FUNCTION_BEGIN(void, glDeleteSamplers, (GLsizei n, const GLuint * samplers), (n, samplers))
_EVASGL_FUNCTION_BEGIN(void, glDeleteSync, (GLsync sync), (sync))
_EVASGL_FUNCTION_BEGIN(void, glDeleteTransformFeedbacks, (GLsizei n, const GLuint *ids), (n, ids))
_EVASGL_FUNCTION_BEGIN(void, glDeleteVertexArrays, (GLsizei n, const GLuint *arrays), (n, arrays))
_EVASGL_FUNCTION_BEGIN(void, glDrawArraysInstanced, (GLenum mode, GLint first, GLsizei count, GLsizei primcount), (mode, first, count, primcount))
_EVASGL_FUNCTION_BEGIN(void, glDrawBuffers, (GLsizei n, const GLenum *bufs), (n, bufs))
_EVASGL_FUNCTION_BEGIN(void, glDrawElementsInstanced, (GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei primcount), (mode, count, type, indices, primcount))
_EVASGL_FUNCTION_BEGIN(void, glDrawRangeElements, (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices), (mode, start, end, count, type, indices))
_EVASGL_FUNCTION_BEGIN(void, glEndQuery, (GLenum target), (target))
_EVASGL_FUNCTION_BEGIN(void, glEndTransformFeedback, (void), ())
_EVASGL_FUNCTION_BEGIN(GLsync, glFenceSync, (GLenum condition, GLbitfield flags), (condition, flags))
_EVASGL_FUNCTION_BEGIN(GLsync, glFlushMappedBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length), (target, offset, length))
_EVASGL_FUNCTION_BEGIN(void, glFramebufferTextureLayer, (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer), (target, attachment, texture, level, layer))
_EVASGL_FUNCTION_BEGIN(void, glGenQueries, (GLsizei n, GLuint * ids), (n, ids))
_EVASGL_FUNCTION_BEGIN(void, glGenSamplers, (GLsizei n, GLuint *samplers), (n, samplers))
_EVASGL_FUNCTION_BEGIN(void, glGenTransformFeedbacks, (GLsizei n, GLuint *ids), (n, ids))
_EVASGL_FUNCTION_BEGIN(void, glGenVertexArrays, (GLsizei n, GLuint *arrays), (n, arrays))
_EVASGL_FUNCTION_BEGIN(void, glGetActiveUniformBlockiv, (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params), (program, uniformBlockIndex, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetActiveUniformBlockName, (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName), (program, uniformBlockIndex, bufSize, length, uniformBlockName))
_EVASGL_FUNCTION_BEGIN(void, glGetActiveUniformsiv, (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params), (program, uniformCount, uniformIndices, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetBufferParameteri64v, (GLenum target, GLenum value, EvasGLint64 * data), (target, value, data))
_EVASGL_FUNCTION_BEGIN(void, glGetBufferPointerv, (GLenum target, GLenum pname, GLvoid ** params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(GLint, glGetFragDataLocation, (GLuint program, const char * name), (program, name))
_EVASGL_FUNCTION_BEGIN(void, glGetInteger64i_v, (GLenum target, GLuint index, EvasGLint64 * data), (target, index, data))
_EVASGL_FUNCTION_BEGIN(void, glGetInteger64v, (GLenum pname, EvasGLint64 * data), (pname, data))
_EVASGL_FUNCTION_BEGIN(void, glGetIntegeri_v, (GLenum target, GLuint index, GLint * data), (target, index, data))
_EVASGL_FUNCTION_BEGIN(void, glGetInternalformativ, (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params), (target, internalformat, pname, bufSize, params))
_EVASGL_FUNCTION_BEGIN(void, glGetProgramBinary, (GLuint program, GLsizei bufsize, GLsizei *length, GLenum *binaryFormat, void *binary), (program, bufsize, length, binaryFormat, binary))
_EVASGL_FUNCTION_BEGIN(void, glGetQueryiv, (GLenum target, GLenum pname, GLint * params), (target, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetQueryObjectuiv, (GLuint id, GLenum pname, GLuint * params), (id, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetSamplerParameterfv, (GLuint sampler, GLenum pname, GLfloat * params), (sampler, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetSamplerParameteriv, (GLuint sampler, GLenum pname, GLint * params), (sampler, pname, params))
_EVASGL_FUNCTION_BEGIN(const GLubyte *, glGetStringi, (GLenum name, GLuint index), (name, index))
_EVASGL_FUNCTION_BEGIN(void, glGetSynciv, (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values), (sync, pname, bufSize, length, values))
_EVASGL_FUNCTION_BEGIN(void, glGetTransformFeedbackVarying, (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, char * name), (program, index, bufSize, length, size, type, name))
_EVASGL_FUNCTION_BEGIN(GLuint, glGetUniformBlockIndex, (GLuint program, const GLchar *uniformBlockName), (program, uniformBlockName))
_EVASGL_FUNCTION_BEGIN(void, glGetUniformIndices, (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices), (program, uniformCount, uniformNames, uniformIndices))
_EVASGL_FUNCTION_BEGIN(void, glGetUniformuiv, (GLuint program, GLint location, GLuint* params), (program, location, params))
_EVASGL_FUNCTION_BEGIN(void, glGetVertexAttribIiv, (GLuint index, GLenum pname, GLint *params), (index, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glGetVertexAttribIuiv, (GLuint index, GLenum pname, GLuint *params), (index, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glInvalidateFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum *attachments), (target, numAttachments, attachments))
_EVASGL_FUNCTION_BEGIN(void, glInvalidateSubFramebuffer, (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height), (target, numAttachments, attachments, x, y, width, height))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsQuery, (GLuint id), (id))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsSampler, (GLuint id), (id))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsSync, (GLsync sync), (sync))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsTransformFeedback, (GLuint id), (id))
_EVASGL_FUNCTION_BEGIN(GLboolean, glIsVertexArray, (GLuint array), (array))
_EVASGL_FUNCTION_BEGIN(void *, glMapBufferRange, (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access), (target, offset, length, access))
_EVASGL_FUNCTION_BEGIN(void, glPauseTransformFeedback, (void), ())
_EVASGL_FUNCTION_BEGIN(void, glProgramBinary, (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length), (program, binaryFormat, binary, length))
_EVASGL_FUNCTION_BEGIN(void, glProgramParameteri, (GLuint program, GLenum pname, GLint value), (program, pname, value))
_EVASGL_FUNCTION_BEGIN(void, glReadBuffer, (GLenum src), (src))
_EVASGL_FUNCTION_BEGIN(void, glRenderbufferStorageMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height), (target, samples, internalformat, width, height))
_EVASGL_FUNCTION_BEGIN(void, glResumeTransformFeedback, (void), ())
_EVASGL_FUNCTION_BEGIN(void, glSamplerParameterf, (GLuint sampler, GLenum pname, GLfloat param), (sampler, pname, param))
_EVASGL_FUNCTION_BEGIN(void, glSamplerParameterfv, (GLuint sampler, GLenum pname, const GLfloat * params), (sampler, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glSamplerParameteri, (GLuint sampler, GLenum pname, GLint param), (sampler, pname, param))
_EVASGL_FUNCTION_BEGIN(void, glSamplerParameteriv, (GLuint sampler, GLenum pname, const GLint * params), (sampler, pname, params))
_EVASGL_FUNCTION_BEGIN(void, glTexImage3D, (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * data), (target, level, internalFormat, width, height, depth, border, format, type, data))
_EVASGL_FUNCTION_BEGIN(void, glTexStorage2D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height), (target, levels, internalformat, width, height))
_EVASGL_FUNCTION_BEGIN(void, glTexStorage3D, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth), (target, levels, internalformat, width, height, depth))
_EVASGL_FUNCTION_BEGIN(void, glTexSubImage3D, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data), (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data))
_EVASGL_FUNCTION_BEGIN(void, glTransformFeedbackVaryings, (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode), (program, count, varyings, bufferMode))
_EVASGL_FUNCTION_BEGIN(void, glUniform1ui, (GLint location, GLuint v0), (location, v0))
_EVASGL_FUNCTION_BEGIN(void, glUniform1uiv, (GLint location, GLsizei count, const GLuint *value), (location, count, value))
_EVASGL_FUNCTION_BEGIN(void, glUniform2ui, (GLint location, GLuint v0, GLuint v1), (location, v0, v1))
_EVASGL_FUNCTION_BEGIN(void, glUniform2uiv, (GLint location, GLsizei count, const GLuint *value), (location, count, value))
_EVASGL_FUNCTION_BEGIN(void, glUniform3ui, (GLint location, GLuint v0, GLuint v1, GLuint v2), (location, v0, v1, v2))
_EVASGL_FUNCTION_BEGIN(void, glUniform3uiv, (GLint location, GLsizei count, const GLuint *value), (location, count, value))
_EVASGL_FUNCTION_BEGIN(void, glUniform4ui, (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3), (location, v0, v1, v2, v3))
_EVASGL_FUNCTION_BEGIN(void, glUniform4uiv, (GLint location, GLsizei count, const GLuint *value), (location, count, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformBlockBinding, (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding), (program, uniformBlockIndex, uniformBlockBinding))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix2x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix3x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix2x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix4x2fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix3x4fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(void, glUniformMatrix4x3fv, (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value), (location, count, transpose, value))
_EVASGL_FUNCTION_BEGIN(GLboolean, glUnmapBuffer, (GLenum target), (target))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttribDivisor, (GLuint index, GLuint divisor), (index, divisor))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttribI4i, (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3), (index, v0, v1, v2, v3))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttribI4iv, (GLuint index, const GLint *v), (index, v))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttribI4ui, (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3), (index, v0, v1, v2, v3))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttribI4uiv, (GLuint index, const GLuint *v), (index, v))
_EVASGL_FUNCTION_BEGIN(void, glVertexAttribIPointer, (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer), (index, size, type, stride, pointer))
_EVASGL_FUNCTION_BEGIN(void, glWaitSync, (GLsync sync, GLbitfield flags, EvasGLuint64 timeout), (sync, flags, timeout))

View File

@ -1112,4 +1112,8 @@ _comp_tex_sub_2d(Evas_Engine_GL_Context *gc, int x, int y, int w, int h, int fmt
#undef EAPI
#define EAPI
extern Eina_Bool _need_context_restore;
extern void _context_restore(void);
EAPI void evas_gl_context_restore_set(Eina_Bool enable);
#endif

View File

@ -32,7 +32,11 @@ static void _internal_resources_destroy(void *eng_data, EVGL_Resource *rsc);
#define EVAS_GL_OPTIONS_DIRECT_MEMORY_OPTIMIZE 0x1000
#define EVAS_GL_OPTIONS_DIRECT_OVERRIDE 0x2000
extern void (*EXT_FUNC_GLES1(glGenFramebuffersOES)) (GLsizei n, GLuint* framebuffers);
extern void (*EXT_FUNC_GLES1(glBindFramebufferOES)) (GLenum target, GLuint framebuffer);
extern void (*EXT_FUNC_GLES1(glFramebufferTexture2DOES)) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
extern void (*EXT_FUNC_GLES1(glFramebufferRenderbufferOES)) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
extern GLenum (*EXT_FUNC_GLES1(glCheckFramebufferStatusOES)) (GLenum target);
//---------------------------------------------------------------//
// Internal Resources:
// - Surface and Context used for internal buffer creation
@ -222,12 +226,12 @@ _texture_attach_2d(GLuint tex, GLenum attach, GLenum attach2, int samples, Eina_
}
else if (use_extension)
{
if (gles1_funcs->glFramebufferTexture2DOES)
gles1_funcs->glFramebufferTexture2DOES(GL_FRAMEBUFFER, attach, GL_TEXTURE_2D, tex, 0);
if (EXT_FUNC_GLES1(glFramebufferTexture2DOES))
EXT_FUNC_GLES1(glFramebufferTexture2DOES)(GL_FRAMEBUFFER, attach, GL_TEXTURE_2D, tex, 0);
if (attach2)
if (gles1_funcs->glFramebufferTexture2DOES)
gles1_funcs->glFramebufferTexture2DOES(GL_FRAMEBUFFER, attach2, GL_TEXTURE_2D, tex, 0);
if (EXT_FUNC_GLES1(glFramebufferTexture2DOES))
EXT_FUNC_GLES1(glFramebufferTexture2DOES)(GL_FRAMEBUFFER, attach2, GL_TEXTURE_2D, tex, 0);
}
else
{
@ -302,8 +306,8 @@ _framebuffer_create(GLuint *buf, Eina_Bool use_extension)
{
if (use_extension)
{
if (gles1_funcs && gles1_funcs->glGenFramebuffersOES)
gles1_funcs->glGenFramebuffersOES(1, buf);
if (EXT_FUNC_GLES1(glGenFramebuffersOES))
EXT_FUNC_GLES1(glGenFramebuffersOES)(1, buf);
}
else
{
@ -316,8 +320,8 @@ _framebuffer_bind(GLuint buf, Eina_Bool use_extension)
{
if (use_extension)
{
if (gles1_funcs && gles1_funcs->glBindFramebufferOES)
gles1_funcs->glBindFramebufferOES(GL_FRAMEBUFFER, buf);
if (EXT_FUNC_GLES1(glBindFramebufferOES))
EXT_FUNC_GLES1(glBindFramebufferOES)(GL_FRAMEBUFFER, buf);
}
else
{
@ -331,8 +335,8 @@ _framebuffer_check(Eina_Bool use_extension)
GLenum ret = 0;
if (use_extension)
{
if (gles1_funcs && gles1_funcs->glCheckFramebufferStatusOES)
ret = gles1_funcs->glCheckFramebufferStatusOES(GL_FRAMEBUFFER);
if (EXT_FUNC_GLES1(glCheckFramebufferStatusOES))
ret = EXT_FUNC_GLES1(glCheckFramebufferStatusOES)(GL_FRAMEBUFFER);
}
else
{
@ -384,8 +388,8 @@ _renderbuffer_attach(GLuint buf, GLenum attach, Eina_Bool use_extension)
{
if (use_extension)
{
if (gles1_funcs->glFramebufferRenderbufferOES)
gles1_funcs->glFramebufferRenderbufferOES(GL_FRAMEBUFFER, attach, GL_RENDERBUFFER, buf);
if (EXT_FUNC_GLES1(glFramebufferRenderbufferOES))
EXT_FUNC_GLES1(glFramebufferRenderbufferOES)(GL_FRAMEBUFFER, attach, GL_RENDERBUFFER, buf);
}
else
{
@ -2944,6 +2948,13 @@ evgl_direct_partial_render_end()
ctx->partial_render = 0;
}
}
void
evas_gl_context_restore_set(Eina_Bool enable)
{
_need_context_restore = enable;
}
//-----------------------------------------------------//

View File

@ -294,6 +294,11 @@ struct _EVGL_Resource
struct {
GLclampf r, g, b, a;
} clear_color;
struct {
void *data;
void *surface;
void *context;
} stored;
};

View File

@ -59,6 +59,55 @@ static Eina_Bool eng_gl_surface_lock(void *data, void *surface);
static Eina_Bool eng_gl_surface_unlock(void *data, void *surface);
static Eina_Bool eng_gl_surface_read_pixels(void *data, void *surface, int x, int y, int w, int h, Evas_Colorspace cspace, void *pixels);
Eina_Bool _need_context_restore = EINA_FALSE;
void
_context_restore(void)
{
EVGL_Resource *rsc = _evgl_tls_resource_get();
if (rsc)
{
if (rsc->id == evgl_engine->main_tid)
{
evgl_make_current(rsc->stored.data, rsc->stored.surface, rsc->stored.context);
_need_context_restore = EINA_FALSE;
}
}
}
static inline void
_context_store(void *data, void *surface, void *context)
{
EVGL_Resource *rsc = _evgl_tls_resource_get();
if (rsc)
{
if (rsc->id == evgl_engine->main_tid)
{
_need_context_restore = EINA_FALSE;
rsc->stored.data = data;
rsc->stored.surface = surface;
rsc->stored.context = context;
}
}
}
static inline void
_context_stored_reset(void *data EINA_UNUSED, void *surface)
{
EVGL_Resource *rsc = _evgl_tls_resource_get();
if (rsc && rsc->stored.surface == surface)
{
_need_context_restore = EINA_FALSE;
rsc->stored.data = NULL;
rsc->stored.surface = NULL;
rsc->stored.context = NULL;
}
}
#define CONTEXT_STORE(data, surface, context) _context_store(data, surface, context)
#define CONTEXT_STORED_RESET(data, surface) _context_stored_reset(data, surface)
static void
eng_rectangle_draw(void *data, void *context, void *surface, int x, int y, int w, int h, Eina_Bool do_async EINA_UNUSED)
{
@ -1420,6 +1469,7 @@ eng_gl_surface_destroy(void *data, void *surface)
EVGL_Surface *sfc = (EVGL_Surface *)surface;
EVGLINIT(data, 0);
CONTEXT_STORED_RESET(data, surface);
return evgl_surface_destroy(data, sfc);
}
@ -1456,6 +1506,7 @@ eng_gl_make_current(void *data, void *surface, void *context)
if (ctx)
{
Evas_Engine_GL_Context *gl_context;
CONTEXT_STORE(data, surface, context);
gl_context = re->window_gl_context_get(re->software.ob);
if ((gl_context->havestuff) ||

View File

@ -79,6 +79,7 @@ Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_relax = 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
@ -1285,6 +1286,8 @@ 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);
#ifdef GL_GLES
#define FINDSYM(dst, sym, typ) \

View File

@ -218,4 +218,7 @@ _re_wincheck(Outbuf *ob)
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,5 +1,7 @@
#include "evas_engine.h"
# define SET_RESTORE_CONTEXT() do { if (glsym_evas_gl_context_restore_set) glsym_evas_gl_context_restore_set(EINA_TRUE); } while(0)
static Eina_TLS _outbuf_key = 0;
static Eina_TLS _context_key = 0;
@ -262,6 +264,7 @@ try_gles2:
if (context == EGL_NO_CONTEXT)
_tls_context_set(gw->egl_context[0]);
SET_RESTORE_CONTEXT();
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
@ -576,6 +579,7 @@ eng_window_free(Outbuf *gw)
glsym_evas_gl_common_context_free(gw->gl_context);
}
#ifdef GL_GLES
SET_RESTORE_CONTEXT();
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (gw->egl_surface[0] != EGL_NO_SURFACE)
eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
@ -614,6 +618,7 @@ eng_window_make_current(void *data, void *doit)
Outbuf *gw = data;
#ifdef GL_GLES
SET_RESTORE_CONTEXT();
if (doit)
{
if (!eglMakeCurrent(gw->egl_disp, gw->egl_surface[0], gw->egl_surface[0], gw->egl_context[0]))
@ -689,6 +694,7 @@ eng_window_use(Outbuf *gw)
#ifdef GL_GLES
if (gw->egl_surface[0] != EGL_NO_SURFACE)
{
SET_RESTORE_CONTEXT();
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
@ -724,6 +730,7 @@ eng_window_unsurf(Outbuf *gw)
glsym_evas_gl_common_context_flush(xwin->gl_context);
if (xwin == gw)
{
SET_RESTORE_CONTEXT();
eglMakeCurrent(gw->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (gw->egl_surface[0] != EGL_NO_SURFACE)
eglDestroySurface(gw->egl_disp, gw->egl_surface[0]);
@ -758,6 +765,7 @@ eng_window_resurf(Outbuf *gw)
(unsigned int)gw->win, eglGetError());
return;
}
SET_RESTORE_CONTEXT();
if (eglMakeCurrent(gw->egl_disp,
gw->egl_surface[0],
gw->egl_surface[0],
@ -1312,6 +1320,7 @@ void
eng_gl_context_use(Context_3D *ctx)
{
#if GL_GLES
SET_RESTORE_CONTEXT();
if (eglMakeCurrent(ctx->display, ctx->surface,
ctx->surface, ctx->context) == EGL_FALSE)
{