Changeset 207616 in webkit
- Timestamp:
- Oct 20, 2016 6:18:09 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207615 r207616 1 2016-10-20 Adam Jackson <ajax@redhat.com> 2 3 Prefer eglGetPlatformDisplay to eglGetDisplay 4 https://bugs.webkit.org/show_bug.cgi?id=163333 5 6 Reviewed by Carlos Garcia Campos. 7 8 eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations 9 do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL 10 what kind of display it is, so let's use it. 11 12 * platform/graphics/wayland/PlatformDisplayWayland.cpp: 13 (WebCore::PlatformDisplayWayland::initialize): 14 * platform/graphics/x11/PlatformDisplayX11.cpp: 15 (WebCore::PlatformDisplayX11::initializeEGLDisplay): 16 1 17 2016-10-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 18 -
trunk/Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp
r207615 r207616 35 35 #include <wayland-egl.h> 36 36 #include <EGL/egl.h> 37 #include <EGL/eglext.h> 37 38 #include <wtf/Assertions.h> 38 39 … … 66 67 wl_display_roundtrip(m_display); 67 68 68 m_eglDisplay = eglGetDisplay(m_display); 69 const char* extensions = eglQueryString(nullptr, EGL_EXTENSIONS); 70 if (GLContext::isExtensionSupported(extensions, "EGL_KHR_platform_base")) { 71 if (auto* getPlatformDisplay = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplay"))) 72 m_eglDisplay = getPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, m_display, nullptr); 73 } else if (GLContext::isExtensionSupported(extensions, "EGL_EXT_platform_base")) { 74 if (auto* getPlatformDisplay = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"))) 75 m_eglDisplay = getPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, m_display, nullptr); 76 } else 77 m_eglDisplay = eglGetDisplay(m_display); 78 69 79 PlatformDisplay::initializeEGLDisplay(); 70 80 } -
trunk/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
r207615 r207616 38 38 #if USE(EGL) 39 39 #include <EGL/egl.h> 40 #include <EGL/eglext.h> 40 41 #endif 41 42 … … 65 66 void PlatformDisplayX11::initializeEGLDisplay() 66 67 { 67 m_eglDisplay = eglGetDisplay(m_display); 68 const char* extensions = eglQueryString(nullptr, EGL_EXTENSIONS); 69 if (GLContext::isExtensionSupported(extensions, "EGL_KHR_platform_base")) { 70 if (auto* getPlatformDisplay = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplay"))) 71 m_eglDisplay = getPlatformDisplay(EGL_PLATFORM_X11_KHR, m_display, nullptr); 72 } else if (GLContext::isExtensionSupported(extensions, "EGL_EXT_platform_base")) { 73 if (auto* getPlatformDisplay = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"))) 74 m_eglDisplay = getPlatformDisplay(EGL_PLATFORM_X11_KHR, m_display, nullptr); 75 } else 76 m_eglDisplay = eglGetDisplay(m_display); 77 68 78 PlatformDisplay::initializeEGLDisplay(); 69 79 }
Note: See TracChangeset
for help on using the changeset viewer.