From 70d9ed501bd041a5d514f04917c4828eeba7c09d Mon Sep 17 00:00:00 2001 From: Minkyoung Kim Date: Mon, 23 Feb 2015 21:31:41 +0900 Subject: [PATCH] Evas GL:Add evasgl extension macro '_EVASGL_EXT_DRVNAME_PRIVATE'. Summary: To distinguish supported extension name from not supported. This patch can be solution to the problem, glGetString() returns non-supported extention name. Test Plan: Local tests Reviewers: raster, jpeg, Hermet, cedric Subscribers: cedric, spacegrapher, wonsik Differential Revision: https://phab.enlightenment.org/D1981 Signed-off-by: Jean-Philippe Andre --- .../evas/engines/gl_common/evas_gl_api_ext.c | 53 +++++++++++++++++++--- .../evas/engines/gl_common/evas_gl_api_ext.h | 4 ++ .../evas/engines/gl_common/evas_gl_api_ext_def.h | 26 ++++++++--- 3 files changed, 70 insertions(+), 13 deletions(-) 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 248b476..87869ed 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 @@ -28,6 +28,7 @@ typedef _getproc_fn (*fp_getproc)(const char *); #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, param) \ ret (*gl_ext_sym_##name) param = NULL; \ @@ -45,6 +46,7 @@ typedef _getproc_fn (*fp_getproc)(const char *); #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 @@ -64,6 +66,9 @@ typedef _getproc_fn (*fp_getproc)(const char *); int _gles1_ext_support_##name = 0; #define _EVASGL_EXT_END() #define _EVASGL_EXT_DRVNAME(name) +#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \ + int _gl_ext_support_func_##name = 0; \ + int _gles1_ext_support_func_##name = 0; #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) #define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) #define _EVASGL_EXT_FUNCTION_END() @@ -79,6 +84,7 @@ typedef _getproc_fn (*fp_getproc)(const char *); #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 @@ -357,6 +363,9 @@ re->info->info.screen); #define _EVASGL_EXT_DRVNAME(name) \ if (_EVASGL_EXT_CHECK_SUPPORT(#name)) *ext_support = 1; +#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \ + if (_EVASGL_EXT_CHECK_SUPPORT(#name)) { *ext_support = 1; _gl_ext_support_func_##name = 1; } + #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \ if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1; @@ -398,6 +407,7 @@ re->info->info.screen); #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 @@ -407,6 +417,10 @@ re->info->info.screen); #undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR #undef GETPROCADDR + ///////////////////////////////////////////////////////////////////////////////////////////////////// + + _gl_ext_string[0] = 0x00; //NULL; + _gl_ext_string_official[0] = 0x00; ///////////////////////////////////////////////////////////////////////////////////////////////////// // Extension HEADER @@ -422,12 +436,18 @@ re->info->info.screen); #define _EVASGL_EXT_END() #define _EVASGL_EXT_CHECK_SUPPORT(name) #define _EVASGL_EXT_DISCARD_SUPPORT() +#define _EVASGL_EXT_DRVNAME_PRINT(name) \ + { \ + strncat(_gl_ext_string, name" ", MAX_EXTENSION_STRING_BUFFER); \ + if ((strncmp(name, "GL", 2) == 0) && (strstr(_gl_ext_string_official, name) == NULL)) \ + strncat(_gl_ext_string_official, name" ", MAX_EXTENSION_STRING_BUFFER); \ + } #define _EVASGL_EXT_DRVNAME(name) \ - if (_curext_supported) \ - { \ - strncat(_gl_ext_string, #name" ", MAX_EXTENSION_STRING_BUFFER); \ - strncat(_gl_ext_string_official, #name" ", MAX_EXTENSION_STRING_BUFFER); \ - } + if (_curext_supported) \ + _EVASGL_EXT_DRVNAME_PRINT(#name) +#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \ + 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_END() @@ -442,8 +462,10 @@ re->info->info.screen); #undef _EVASGL_EXT_DISCARD_SUPPORT #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END +#undef _EVASGL_EXT_DRVNAME_PRINT #undef _EVASGL_EXT_DRVNAME #undef _EVASGL_EXT_DRVNAME_DESKTOP +#undef _EVASGL_EXT_DRVNAME_PRIVATE #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN @@ -481,6 +503,7 @@ evgl_api_ext_get(Evas_GL_API *gl_funcs) #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, param) \ ORD(name); @@ -503,6 +526,7 @@ evgl_api_ext_get(Evas_GL_API *gl_funcs) #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 @@ -606,6 +630,8 @@ _evgl_api_gles1_ext_init(void) #define _EVASGL_EXT_DRVNAME(name) \ if (_EVASGL_EXT_CHECK_SUPPORT(#name)) *ext_support = 1; +#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \ + if (_EVASGL_EXT_CHECK_SUPPORT(#name)) { *ext_support = 1; _gles1_ext_support_func_##name = 1; } #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \ if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1; @@ -652,6 +678,7 @@ _evgl_api_gles1_ext_init(void) #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 @@ -672,7 +699,17 @@ _evgl_api_gles1_ext_init(void) #define _EVASGL_EXT_END() #define _EVASGL_EXT_CHECK_SUPPORT(name) #define _EVASGL_EXT_DISCARD_SUPPORT() -#define _EVASGL_EXT_DRVNAME(name) if (_curext_supported) strcat(_gles1_ext_string, #name" "); +#define _EVASGL_EXT_DRVNAME_PRINT(name) \ + { \ + if ((strncmp(name, "GL", 2) == 0) && (strstr(_gles1_ext_string, name) == NULL)) \ + strcat(_gles1_ext_string, name" "); \ + } +#define _EVASGL_EXT_DRVNAME(name) \ + if (_curext_supported) \ + _EVASGL_EXT_DRVNAME_PRINT(#name) +#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \ + 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_END() @@ -687,7 +724,9 @@ _evgl_api_gles1_ext_init(void) #undef _EVASGL_EXT_DISCARD_SUPPORT #undef _EVASGL_EXT_BEGIN #undef _EVASGL_EXT_END +#undef _EVASGL_EXT_DRVNAME_PRINT #undef _EVASGL_EXT_DRVNAME +#undef _EVASGL_EXT_DRVNAME_PRIVATE #undef _EVASGL_EXT_DRVNAME_DESKTOP #undef _EVASGL_EXT_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END @@ -740,6 +779,7 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs) #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, param) \ ORD(name); @@ -761,6 +801,7 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs) #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 diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h index c9e13b5..56d5dae 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h +++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h @@ -24,6 +24,7 @@ #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, param) extern ret (*gl_ext_sym_##name) param; #define _EVASGL_EXT_FUNCTION_END() @@ -39,6 +40,7 @@ #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 @@ -58,6 +60,7 @@ #define _EVASGL_EXT_BEGIN(name) extern int _gl_ext_support_##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, param) #define _EVASGL_EXT_FUNCTION_END() @@ -73,6 +76,7 @@ #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 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 a3a968b..ae738cb 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 @@ -14,6 +14,7 @@ // Driver extensions to wrap (name : SPEC extension name) #define _EVASGL_EXT_DRVNAME(name) +#define _EVASGL_EXT_DRVNAME_PRIVATE(name) #define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) // These functions will be exported to 'EVAS extension function'. @@ -44,6 +45,11 @@ #endif ////////////////////////////////////////////////////////////////////////////////////////////////// +#ifndef _EVASGL_EXT_DRVNAME_PRIVATE +#define _EVASGL_EXT_DRVNAME_PRIVATE(name) _EVASGL_EXT_DRVNAME(name) +#define _EVASGL_EXT_DRVNAME_PRIVATE_DEFINED +#endif + #ifndef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(ret, name, param) _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) #define _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN_DEFINED @@ -301,8 +307,8 @@ _EVASGL_EXT_BEGIN(EXT_multisampled_render_to_texture) _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(multisampled_render_to_texture) - _EVASGL_EXT_DRVNAME(GL_IMG_multisampled_render_to_texture) - _EVASGL_EXT_DRVNAME(GL_EXT_multisampled_render_to_texture) + _EVASGL_EXT_DRVNAME_PRIVATE(GL_IMG_multisampled_render_to_texture) + _EVASGL_EXT_DRVNAME_PRIVATE(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_PROCADDR("glRenderbufferStorageMultisample") @@ -1354,8 +1360,8 @@ _EVASGL_EXT_END() // ---------------------------------------------------------- _EVASGL_EXT_BEGIN(framebuffer_blit) -_EVASGL_EXT_DRVNAME(GL_NV_framebuffer_blit) -_EVASGL_EXT_DRVNAME(GL_ANGLE_framebuffer_blit) +_EVASGL_EXT_DRVNAME_PRIVATE(GL_NV_framebuffer_blit) +_EVASGL_EXT_DRVNAME_PRIVATE(GL_ANGLE_framebuffer_blit) _EVASGL_EXT_FUNCTION_WHITELIST("glBlitFramebuffer") _EVASGL_EXT_FUNCTION_WHITELIST("glBlitFramebufferNV") @@ -1548,9 +1554,9 @@ _EVASGL_EXT_END() _EVASGL_EXT_BEGIN(EGL_KHR_fence_sync) /* 3 aliasses for EGL_KHR_fence_sync */ - _EVASGL_EXT_DRVNAME(EGL_KHR_fence_sync) - _EVASGL_EXT_DRVNAME(GL_OES_EGL_sync) - _EVASGL_EXT_DRVNAME(VG_KHR_EGL_sync) + _EVASGL_EXT_DRVNAME_PRIVATE(EGL_KHR_fence_sync) + _EVASGL_EXT_DRVNAME_PRIVATE(GL_OES_EGL_sync) + _EVASGL_EXT_DRVNAME_PRIVATE(VG_KHR_EGL_sync) _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void *, eglCreateSyncKHR, (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)) _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("eglCreateSyncKHR") @@ -1715,12 +1721,18 @@ _EVASGL_EXT_END() #undef _EVASGL_EXT_FUNCTION_PRIVATE_END_DEFINED #endif +#ifdef _EVASGL_EXT_DRVNAME_PRIVATE_DEFINED +#undef _EVASGL_EXT_DRVNAME_PRIVATE +#undef _EVASGL_EXT_DRVNAME_PRIVATE_DEFINED +#endif + #ifdef _EVASGL_EXT_USE_DEFAULT_DEFINE #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_FUNCTION_BEGIN #undef _EVASGL_EXT_FUNCTION_END #undef _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN -- 2.7.4