summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-14 17:27:23 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-14 19:46:47 +0900
commitec7111938c80a28671793f586f62df1e02b39ec9 (patch)
tree32c7b388d7d9dc1573272a3172d7dc5514dd0409
parent86d1b190c2c013db3b8bad6644aa28c303fe2f2d (diff)
Evas GL: Minor changes inside glGetString
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c
index f91fc35b75..a97204e087 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api.c
@@ -657,7 +657,7 @@ _evgl_glGetString(GLenum name)
657 static char _version[128] = {0}; 657 static char _version[128] = {0};
658 static char _glsl[128] = {0}; 658 static char _glsl[128] = {0};
659 EVGL_Resource *rsc; 659 EVGL_Resource *rsc;
660 const GLubyte *ret; 660 const char *ret;
661 661
662 /* We wrap two values here: 662 /* We wrap two values here:
663 * 663 *
@@ -678,6 +678,10 @@ _evgl_glGetString(GLenum name)
678 * --> crash moved to app side if they blindly call strstr() 678 * --> crash moved to app side if they blindly call strstr()
679 */ 679 */
680 680
681 /* NOTE: Please modify software_generic/evas_engine.c as well if you change
682 * this function!
683 */
684
681 if ((!(rsc = _evgl_tls_resource_get())) || !rsc->current_ctx) 685 if ((!(rsc = _evgl_tls_resource_get())) || !rsc->current_ctx)
682 { 686 {
683 ERR("Current context is NULL, not calling glGetString"); 687 ERR("Current context is NULL, not calling glGetString");
@@ -694,17 +698,17 @@ _evgl_glGetString(GLenum name)
694 break; 698 break;
695 699
696 case GL_SHADING_LANGUAGE_VERSION: 700 case GL_SHADING_LANGUAGE_VERSION:
697 ret = glGetString(GL_SHADING_LANGUAGE_VERSION); 701 ret = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
698 if (!ret) return NULL; 702 if (!ret) return NULL;
699#ifdef GL_GLES 703#ifdef GL_GLES
700 if (ret[18] != (GLubyte) '1') 704 if (ret[18] != '1')
701 { 705 {
702 // We try not to remove the vendor fluff 706 // We try not to remove the vendor fluff
703 snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", ((char *) ret) + 18); 707 snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", ret + 18);
704 _glsl[sizeof(_glsl) - 1] = '\0'; 708 _glsl[sizeof(_glsl) - 1] = '\0';
705 return (const GLubyte *) _glsl; 709 return (const GLubyte *) _glsl;
706 } 710 }
707 return ret; 711 return (const GLubyte *) ret;
708#else 712#else
709 // Desktop GL, we still keep the official name 713 // Desktop GL, we still keep the official name
710 snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", (char *) ret); 714 snprintf(_glsl, sizeof(_glsl), "OpenGL ES GLSL ES 1.00 Evas GL (%s)", (char *) ret);
@@ -713,17 +717,17 @@ _evgl_glGetString(GLenum name)
713#endif 717#endif
714 718
715 case GL_VERSION: 719 case GL_VERSION:
716 ret = glGetString(GL_VERSION); 720 ret = (const char *) glGetString(GL_VERSION);
717 if (!ret) return NULL; 721 if (!ret) return NULL;
718#ifdef GL_GLES 722#ifdef GL_GLES
719 if ((ret[10] != (GLubyte) '2') && (ret[10] != (GLubyte) '3')) 723 if ((ret[10] != '2') && (ret[10] != '3'))
720 { 724 {
721 // We try not to remove the vendor fluff 725 // We try not to remove the vendor fluff
722 snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", ((char *) ret) + 10); 726 snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", ret + 10);
723 _version[sizeof(_version) - 1] = '\0'; 727 _version[sizeof(_version) - 1] = '\0';
724 return (const GLubyte *) _version; 728 return (const GLubyte *) _version;
725 } 729 }
726 return ret; 730 return (const GLubyte *) ret;
727#else 731#else
728 // Desktop GL, we still keep the official name 732 // Desktop GL, we still keep the official name
729 snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", (char *) ret); 733 snprintf(_version, sizeof(_version), "OpenGL ES 2.0 Evas GL (%s)", (char *) ret);