RESOLVED FIXED Bug 161958
[GTK] Avoid strstr() when checking (E)GL extensions
https://bugs.webkit.org/show_bug.cgi?id=161958
Summary [GTK] Avoid strstr() when checking (E)GL extensions
Emanuele Aina
Reported 2016-09-14 05:27:55 PDT
Using strstr() is not sufficient to safely check for (E)GL extensions, because it may match a substring of the extension name you're testing for. For example, if you're testing for the GL_EXT_texture extension and glGetString(GL_EXTENSIONS) returns "GL_EXT_texture3D" then simply using strstr() will incorrectly tell you that GL_EXT_texture is supported. (From http://www.mesa3d.org/brianp/sig97/exten.htm ) We currently use strstr() with no extra checks in GLContextEGL::createSurfacelessContext() (for EGL_KHR_surfaceless_context and EGL_KHR_surfaceless_opengl) and in WaylandCompositor::initializeEGL() (for EGL_KHR_image_base). GLPlatformContext::supportsEGLExtension() does it correctly, but it seems to belong to a separate tree of GL context types (GLPlatformContext, GLXOffscreenContext and EGLOffscreenContext) which is are not used by the GTK+ port (which uses GLContext, GLContextGLX and GLContextEGL, usually by way of GraphicsContext3D).
Attachments
Patch (5.72 KB, patch)
2016-10-20 01:58 PDT, Carlos Garcia Campos
zan: review+
Carlos Garcia Campos
Comment 1 2016-10-20 01:58:43 PDT
Carlos Garcia Campos
Comment 2 2016-10-20 05:39:00 PDT
Note You need to log in before you can comment on or make changes to this bug.