Changeset 207614 in webkit
- Timestamp:
- Oct 20, 2016 5:36:06 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207591 r207614 1 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Avoid strstr() when checking (E)GL extensions 4 https://bugs.webkit.org/show_bug.cgi?id=161958 5 6 Reviewed by Žan Doberšek. 7 8 Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension 9 list, and use it instead of strstr(). 10 11 * platform/graphics/GLContext.cpp: 12 (WebCore::GLContext::isExtensionSupported): 13 * platform/graphics/GLContext.h: 14 * platform/graphics/egl/GLContextEGL.cpp: 15 (WebCore::GLContextEGL::createSurfacelessContext): 16 * platform/graphics/glx/GLContextGLX.cpp: 17 (WebCore::hasSGISwapControlExtension): 18 1 19 2016-10-20 Per Arne Vollan <pvollan@apple.com> 2 20 -
trunk/Source/WebCore/platform/graphics/GLContext.cpp
r205544 r207614 150 150 } 151 151 152 bool GLContext::isExtensionSupported(const char* extensionList, const char* extension) 153 { 154 if (!extensionList) 155 return false; 156 157 ASSERT(extension); 158 int extensionLen = strlen(extension); 159 const char* extensionListPtr = extensionList; 160 while ((extensionListPtr = strstr(extensionListPtr, extension))) { 161 if (extensionListPtr[extensionLen] == ' ' || extensionListPtr[extensionLen] == '\0') 162 return true; 163 extensionListPtr += extensionLen; 164 } 165 return false; 166 } 167 152 168 } // namespace WebCore 153 169 -
trunk/Source/WebCore/platform/graphics/GLContext.h
r205116 r207614 49 49 static std::unique_ptr<GLContext> createSharingContext(PlatformDisplay&); 50 50 static GLContext* current(); 51 static bool isExtensionSupported(const char* extensionList, const char* extension); 51 52 52 53 PlatformDisplay& display() const { return m_display; } -
trunk/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
r207590 r207614 152 152 153 153 const char* extensions = eglQueryString(display, EGL_EXTENSIONS); 154 if (! strstr(extensions, "EGL_KHR_surfaceless_context") && !strstr(extensions, "EGL_KHR_surfaceless_opengl"))154 if (!GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_context") && !GLContext::isExtensionSupported(extensions, "EGL_KHR_surfaceless_opengl")) 155 155 return nullptr; 156 156 -
trunk/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
r205852 r207614 46 46 47 47 initialized = true; 48 const char* extensions = glXQueryExtensionsString(display, 0); 49 if (!strstr(extensions, "GLX_SGI_swap_control")) 48 if (!GLContext::isExtensionSupported(glXQueryExtensionsString(display, 0), "GLX_SGI_swap_control")) 50 49 return false; 51 50 -
trunk/Source/WebKit2/ChangeLog
r207590 r207614 1 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Avoid strstr() when checking (E)GL extensions 4 https://bugs.webkit.org/show_bug.cgi?id=161958 5 6 Reviewed by Žan Doberšek. 7 8 Use GLContext::isExtensionSupported() instead of strstr(). 9 10 * UIProcess/gtk/WaylandCompositor.cpp: 11 (WebKit::WaylandCompositor::initializeEGL): 12 1 13 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 14 -
trunk/Source/WebKit2/UIProcess/gtk/WaylandCompositor.cpp
r206961 r207614 336 336 } else { 337 337 const char* extensions = eglQueryString(PlatformDisplay::sharedDisplay().eglDisplay(), EGL_EXTENSIONS); 338 if ( strstr(extensions, "EGL_KHR_image_base")) {338 if (GLContext::isExtensionSupported(extensions, "EGL_KHR_image_base")) { 339 339 eglCreateImage = reinterpret_cast<PFNEGLCREATEIMAGEKHRPROC>(eglGetProcAddress("eglCreateImageKHR")); 340 340 eglDestroyImage = reinterpret_cast<PFNEGLDESTROYIMAGEKHRPROC>(eglGetProcAddress("eglDestroyImageKHR"));
Note: See TracChangeset
for help on using the changeset viewer.