Changeset 269841 in webkit
- Timestamp:
- Nov 16, 2020 2:05:32 AM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269840 r269841 1 2020-11-16 Zan Dobersek <zdobersek@igalia.com> 2 3 PlatformDisplayLibWPE: use eglGetPlatformDisplay when possible 4 https://bugs.webkit.org/show_bug.cgi?id=218941 5 6 Reviewed by Carlos Garcia Campos. 7 8 Use the existing wpe_renderer_backend_egl API to detect any desired 9 EGL platform that should be used to retrieve the global EGLDisplay 10 object. If such a platform is specified, the eglGetPlatformDisplay 11 entrypoing from the EGL_EXT_platform_base extension should be used 12 to retrieve the corresponding EGLDisplay. 13 14 If the API or the extension is not available, or if the EGLDisplay is 15 not retrieved this way, we fall back to eglGetDisplay. 16 17 * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: 18 (WebCore::PlatformDisplayLibWPE::initialize): 19 1 20 2020-11-10 Sergio Villar Senin <svillar@igalia.com> 2 21 -
trunk/Source/WebCore/platform/graphics/libwpe/PlatformDisplayLibWPE.cpp
r251122 r269841 47 47 #include <wpe/wpe-egl.h> 48 48 49 #ifndef EGL_EXT_platform_base 50 #define EGL_EXT_platform_base 1 51 typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); 52 #endif 53 49 54 namespace WebCore { 50 55 … … 71 76 m_backend = wpe_renderer_backend_egl_create(hostFd); 72 77 73 m_eglDisplay = eglGetDisplay(wpe_renderer_backend_egl_get_native_display(m_backend)); 78 EGLNativeDisplayType eglNativeDisplay = wpe_renderer_backend_egl_get_native_display(m_backend); 79 80 #if WPE_CHECK_VERSION(1, 1, 0) 81 uint32_t eglPlatform = wpe_renderer_backend_egl_get_platform(m_backend); 82 if (eglPlatform) { 83 using GetPlatformDisplayType = PFNEGLGETPLATFORMDISPLAYEXTPROC; 84 GetPlatformDisplayType getPlatformDisplay = 85 [] { 86 const char* extensions = eglQueryString(nullptr, EGL_EXTENSIONS); 87 if (GLContext::isExtensionSupported(extensions, "EGL_EXT_platform_base") 88 || GLContext::isExtensionSupported(extensions, "EGL_KHR_platform_base")) 89 return reinterpret_cast<GetPlatformDisplayType>(eglGetProcAddress("eglGetPlatformDisplay")); 90 return GetPlatformDisplayType(nullptr); 91 }(); 92 93 if (getPlatformDisplay) 94 m_eglDisplay = getPlatformDisplay(eglPlatform, eglNativeDisplay, nullptr); 95 } 96 #endif 97 98 if (m_eglDisplay == EGL_NO_DISPLAY) 99 m_eglDisplay = eglGetDisplay(eglNativeDisplay); 74 100 if (m_eglDisplay == EGL_NO_DISPLAY) { 75 101 WTFLogAlways("PlatformDisplayLibWPE: could not create the EGL display: %s.", GLContextEGL::lastErrorString());
Note: See TracChangeset
for help on using the changeset viewer.