From 57f2e02b9e2f5c104ff3d856f42b6dcd19756d4d Mon Sep 17 00:00:00 2001 From: Sung Park Date: Thu, 22 Nov 2012 07:58:06 +0000 Subject: [PATCH] Fixed a bug where if an image object rendered using Evas GL direct rendering and then another image object using Native Surface rendering, there was a potential for it to fall into the same direct rendering path. Also, fixed some minor Evas GL extension bugs that came from refactoring. SVN revision: 79532 --- ChangeLog | 9 +++++++++ .../evas/engines/gl_common/evas_gl_api_ext.c | 7 ++++--- .../engines/gl_common/evas_gl_api_ext_def.h | 17 +++++++++++++++++ src/modules/evas/engines/gl_x11/evas_engine.c | 17 ++++++++--------- 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80b8096e66..a83354ffd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-11-22 Sung W. Park (sung_) + + * Fixed a bug where if an image object rendered using Evas GL + direct rendering and then another image object using Native + Surface rendering, there was a potential for it to fall into + the same direct rendering path. + * Fixed some minor Evas GL extension bugs that came from refactoring. + + 2012-11-21 Carsten Haitzler (The Rasterman) * Fixed leak in textblock and text props in general that made diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c index 4f81ccf4dc..0fc757ee94 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c @@ -151,7 +151,8 @@ re->info->info.screen); #define _EVASGL_EXT_BEGIN(name) \ { \ - int *ext_support = &_gl_ext_support_##name; + int *ext_support = &_gl_ext_support_##name; \ + *ext_support = 0; #define _EVASGL_EXT_END() \ } @@ -160,7 +161,7 @@ re->info->info.screen); (strstr(glexts, #name) != NULL || strstr(glueexts, #name) != NULL) #define _EVASGL_EXT_DISCARD_SUPPORT() \ - ext_support = 0; + *ext_support = 0; #define _EVASGL_EXT_DRVNAME(name) \ if (_EVASGL_EXT_CHECK_SUPPORT(name)) *ext_support = 1; @@ -174,7 +175,7 @@ re->info->info.screen); } #define _EVASGL_EXT_FUNCTION_DRVFUNC(name) \ - *drvfunc = name; + if ((*drvfunc) == NULL) *drvfunc = name; #include "evas_gl_api_ext_def.h" diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h index d5d1fa3b2b..ff63913100 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h @@ -52,9 +52,11 @@ _EVASGL_EXT_BEGIN(get_program_binary) _EVASGL_EXT_FUNCTION_BEGIN(void, glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetProgramBinary")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetProgramBinaryOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glProgramBinaryOES, (GLuint program, GLenum binaryFormat, const void *binary, GLint length)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glProgramBinary")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glProgramBinaryOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_END() @@ -64,12 +66,15 @@ _EVASGL_EXT_BEGIN(mapbuffer) _EVASGL_EXT_FUNCTION_BEGIN(void *, glMapBufferOES, (GLenum target, GLenum access)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMapBuffer")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMapBufferOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(GLboolean, glUnmapBufferOES, (GLenum target)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glUnmapBuffer")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glUnmapBufferOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glGetBufferPointervOES, (GLenum target, GLenum pname, void** params)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetBufferPointerv")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glGetBufferPointervOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_END() @@ -78,21 +83,27 @@ _EVASGL_EXT_BEGIN(texture_3D) _EVASGL_EXT_FUNCTION_BEGIN(void, glTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glTexImage3D")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glTexImage3DOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glTexSubImage3D")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glTexSubImage3DOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glCopyTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCopyTexSubImage3D")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCopyTexSubImage3DOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glCompressedTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCompressedTexImage3D")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCompressedTexImage3DOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glCompressedTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCompressedTexSubImage3D")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glCompressedTexSubImage3DOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture3D")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture3DOES")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_END() @@ -141,6 +152,7 @@ _EVASGL_EXT_BEGIN(discard_framebuffer) _EVASGL_EXT_FUNCTION_BEGIN(void, glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum* attachments)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glDiscardFramebuffer")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glDiscardFramebufferEXT")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_END() @@ -150,8 +162,11 @@ _EVASGL_EXT_BEGIN(multi_draw_arrays) _EVASGL_EXT_FUNCTION_BEGIN(void, glMultiDrawArraysEXT, (GLenum mode, GLint* first, GLsizei* count, GLsizei primcount)) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMultiDrawArrays")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMultiDrawArraysEXT")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_FUNCTION_BEGIN(void, glMultiDrawElementsEXT, (GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount)) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMultiDrawElements")) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMultiDrawElementsEXT")) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glMultiDrawElementsARB")) _EVASGL_EXT_FUNCTION_END() _EVASGL_EXT_END() @@ -254,10 +269,12 @@ _EVASGL_EXT_BEGIN(multisampled_render_to_texture) _EVASGL_EXT_DRVNAME(GL_EXT_multisampled_render_to_texture) _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glRenderbufferStorageMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glRenderbufferStorageMultisample")) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glRenderbufferStorageMultisampleIMG")) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glRenderbufferStorageMultisampleEXT")) _EVASGL_EXT_FUNCTION_PRIVATE_END() _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glFramebufferTexture2DMultisample, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)) + _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture2DMultisample")) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture2DMultisampleIMG")) _EVASGL_EXT_FUNCTION_DRVFUNC(GETPROCADDR("glFramebufferTexture2DMultisampleEXT")) _EVASGL_EXT_FUNCTION_PRIVATE_END() diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index ae5242a995..fbf897fd25 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -41,7 +41,6 @@ struct _Render_Engine static int initted = 0; static int gl_wins = 0; -static int _ext_initted = 0; typedef void (*_eng_fn) (void); typedef _eng_fn (*glsym_func_eng_fn) (); @@ -513,7 +512,7 @@ static EVGL_Interface evgl_funcs = static void -_ext_sym_init(void) +gl_symbols(void) { static int done = 0; @@ -584,6 +583,8 @@ _ext_sym_init(void) FINDSYM(glsym_glXSwapIntervalEXT, "glXSwapIntervalEXT", glsym_func_void); #endif + + done = 1; } int _evas_engine_GL_X11_log_dom = -1; @@ -682,6 +683,8 @@ eng_setup(Evas *eo_e, void *in) if (!initted) { + gl_symbols(); + evas_common_cpu_init(); evas_common_blend_init(); evas_common_image_init(); @@ -834,12 +837,6 @@ eng_setup(Evas *eo_e, void *in) re->vsync = 0; - if (!_ext_initted) - { - _ext_sym_init(); - _ext_initted = 1 ; - } - return 1; } @@ -2491,7 +2488,9 @@ eng_image_draw(void *data, void *context, void *surface, void *image, int src_x, if (!im) return; n = im->native.data; - if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL) && (evgl_direct_rendered(re->evgl_engine))) + if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL) && + (n->ns.data.opengl.framebuffer_id == 0) && + (evgl_direct_rendered(re->evgl_engine))) { DBG("Rendering Directly to the window"); evas_object_image_pixels_dirty_set(evgl_direct_img_obj_get(re->evgl_engine), EINA_TRUE);