WebKit Bugzilla
Attachment 362385 Details for
Bug 194817
: [EGL] Runtime support for RGB565 pixel layout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194817-20190219153012.patch (text/plain), 34.56 KB, created by
Philippe Normand
on 2019-02-19 07:30:14 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Philippe Normand
Created:
2019-02-19 07:30:14 PST
Size:
34.56 KB
patch
obsolete
>Subversion Revision: 241760 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5bdc6d3fa0a049d3046409362ea006d8fefb7ab0..8f9a8affcd0db7e60652b7b11898e3dae44cf9e5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2019-02-19 Philippe Normand <pnormand@igalia.com> >+ >+ [WPE][EGL] Runtime support for 16 bpp EGL configurations >+ https://bugs.webkit.org/show_bug.cgi?id=194817 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Currently our graphics pipeline always relies on a ARGB8888 (32 >+ bpp) pixel configuration. On some low-end (old) embedded platforms >+ the graphics driver is sometimes optimized for 16 bpp >+ configurations, such as RGB565. On those platforms the application >+ can now configure the egl-config-bits-per-pixel setting value to >+ adjust to the best pixel configuration supported by the screen and >+ graphics driver. >+ >+ * page/Settings.yaml: Add a new eglConfigBitsPerPixel web-setting. >+ * platform/graphics/GLContext.cpp: >+ (WebCore::GLContext::createContextForWindow): Optional >+ eglConfigBitsPerPixel argument, defaulting to 32bpp. >+ (WebCore::GLContext::createSharingContext): Ditto. >+ * platform/graphics/GLContext.h: >+ * platform/graphics/PlatformDisplay.cpp: >+ (WebCore::PlatformDisplay::sharingGLContext): Ditto. >+ * platform/graphics/PlatformDisplay.h: >+ * platform/graphics/egl/GLContextEGL.cpp: >+ (WebCore::GLContextEGL::getEGLConfig): Disable alpha and stencil >+ for 16bpp configurations. Also perform filtering of the probed >+ configuration to select the one hinted by the passed pixel >+ resolution value. >+ (WebCore::GLContextEGL::createWindowContext): Optional >+ eglConfigBitsPerPixel argument, defaulting to 32bpp. >+ (WebCore::GLContextEGL::createSurfacelessContext): Ditto. >+ (WebCore::GLContextEGL::createContext): Ditto. >+ (WebCore::GLContextEGL::createSharingContext): Ditto. >+ * platform/graphics/egl/GLContextEGL.h: >+ * platform/graphics/egl/GLContextEGLLibWPE.cpp: >+ (WebCore::GLContextEGL::createWPEContext): Ditto. >+ > 2019-02-16 Darin Adler <darin@apple.com> > > Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 49a21d9da5bf5c9b72dc98218272aa389899ca1c..7020a049545ac9587ac4c0e1467f9085a0ad2e65 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,38 @@ >+2019-02-19 Philippe Normand <pnormand@igalia.com> >+ >+ [WPE][EGL] Runtime support for 16 bpp EGL configurations >+ https://bugs.webkit.org/show_bug.cgi?id=194817 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: >+ (WebKit::ThreadedCompositor::createGLContext): Use the client's >+ egl-config-bits-per-pixel value when creating the GL context. >+ * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: >+ * Shared/WebPreferences.yaml: Add new EglConfigBitsPerPixel WebPreference. >+ * UIProcess/API/C/WKPreferences.cpp: >+ (WKPreferencesSetEGLConfigBitsPerPixel): >+ (WKPreferencesGetEGLConfigBitsPerPixel): >+ * UIProcess/API/glib/WebKitSettings.cpp: New egl-config-bits-per-pixel WPE WebSetting. >+ (webKitSettingsSetProperty): >+ (webKitSettingsGetProperty): >+ (webkit_settings_class_init): >+ (webkit_settings_get_egl_config_bits_per_pixel): >+ (webkit_settings_set_egl_config_bits_per_pixel): >+ * UIProcess/API/wpe/WebKitSettings.h: >+ * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: >+ * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: >+ (WebKit::ThreadedCoordinatedLayerTreeHost::eglConfigBitsPerPixel): >+ Chain to WebPage's elgConfigBitsPerPixel value or fallback to 32 >+ bpp on non WPE platforms. >+ * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::updatePreferences): Update WebPage's >+ eglConfigBitsPerPixel value when the corresponding setting has >+ changes. >+ * WebProcess/WebPage/WebPage.h: >+ (WebKit::WebPage::eglConfigBitsPerPixel const): >+ > 2019-02-19 Antoine Quint <graouts@apple.com> > > [iOS] "touch-action: none" should not prevent text selection or tapping on a link >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index 54585beb664dd11980692e95195a0c203fc2f173..7883fa7a646fbded20d3a967459457c4296cdacb 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -800,6 +800,10 @@ editableImagesEnabled: > adClickAttributionEnabled: > initial: false > >+eglConfigBitsPerPixel: >+ type: int >+ initial: 32 >+ > # Deprecated > > iceCandidateFilteringEnabled: >diff --git a/Source/WebCore/platform/graphics/GLContext.cpp b/Source/WebCore/platform/graphics/GLContext.cpp >index f6d30db58e52bd97b7077521714a601a1263f510..f5239b19bcb7b7f4126108815b6bb7449ef93230 100644 >--- a/Source/WebCore/platform/graphics/GLContext.cpp >+++ b/Source/WebCore/platform/graphics/GLContext.cpp >@@ -76,8 +76,12 @@ static bool initializeOpenGLShimsIfNeeded() > #endif > } > >-std::unique_ptr<GLContext> GLContext::createContextForWindow(GLNativeWindowType windowHandle, PlatformDisplay* platformDisplay) >+std::unique_ptr<GLContext> GLContext::createContextForWindow(GLNativeWindowType windowHandle, PlatformDisplay* platformDisplay, uint32_t eglConfigBitsPerPixel) > { >+#if !USE(EGL) >+ UNUSED_PARAM(eglConfigBitsPerPixel); >+#endif >+ > if (!initializeOpenGLShimsIfNeeded()) > return nullptr; > >@@ -95,7 +99,7 @@ std::unique_ptr<GLContext> GLContext::createContextForWindow(GLNativeWindowType > return WTFMove(glxContext); > #endif > #if USE(EGL) >- if (auto eglContext = GLContextEGL::createContext(windowHandle, display)) >+ if (auto eglContext = GLContextEGL::createContext(windowHandle, display, eglConfigBitsPerPixel)) > return WTFMove(eglContext); > #endif > return nullptr; >@@ -109,7 +113,7 @@ std::unique_ptr<GLContext> GLContext::createOffscreenContext(PlatformDisplay* pl > return createContextForWindow(0, platformDisplay ? platformDisplay : &PlatformDisplay::sharedDisplay()); > } > >-std::unique_ptr<GLContext> GLContext::createSharingContext(PlatformDisplay& display) >+std::unique_ptr<GLContext> GLContext::createSharingContext(PlatformDisplay& display, uint32_t eglConfigBitsPerPixel) > { > if (!initializeOpenGLShimsIfNeeded()) > return nullptr; >@@ -122,8 +126,10 @@ std::unique_ptr<GLContext> GLContext::createSharingContext(PlatformDisplay& disp > #endif > > #if USE(EGL) || PLATFORM(WAYLAND) || PLATFORM(WPE) >- if (auto eglContext = GLContextEGL::createSharingContext(display)) >+ if (auto eglContext = GLContextEGL::createSharingContext(display, eglConfigBitsPerPixel)) > return WTFMove(eglContext); >+#else >+ UNUSED_PARAM(eglConfigBitsPerPixel); > #endif > > return nullptr; >diff --git a/Source/WebCore/platform/graphics/GLContext.h b/Source/WebCore/platform/graphics/GLContext.h >index 8615ea06d875b26db109fbcd462f800feb972753..d10d1417622a54304225164da7508b05cf1c3609 100644 >--- a/Source/WebCore/platform/graphics/GLContext.h >+++ b/Source/WebCore/platform/graphics/GLContext.h >@@ -45,9 +45,9 @@ namespace WebCore { > class GLContext { > WTF_MAKE_NONCOPYABLE(GLContext); WTF_MAKE_FAST_ALLOCATED; > public: >- WEBCORE_EXPORT static std::unique_ptr<GLContext> createContextForWindow(GLNativeWindowType windowHandle, PlatformDisplay* = nullptr); >+ WEBCORE_EXPORT static std::unique_ptr<GLContext> createContextForWindow(GLNativeWindowType windowHandle, PlatformDisplay* = nullptr, uint32_t eglConfigBitsPerPixel = 32); > static std::unique_ptr<GLContext> createOffscreenContext(PlatformDisplay* = nullptr); >- static std::unique_ptr<GLContext> createSharingContext(PlatformDisplay&); >+ static std::unique_ptr<GLContext> createSharingContext(PlatformDisplay&, uint32_t eglConfigBitsPerPixel = 32); > static GLContext* current(); > static bool isExtensionSupported(const char* extensionList, const char* extension); > >diff --git a/Source/WebCore/platform/graphics/PlatformDisplay.cpp b/Source/WebCore/platform/graphics/PlatformDisplay.cpp >index d23c60792ea9702e6992aec6876e093c55f2d317..20c16e2865f23551c720255cf940b7569d00447b 100644 >--- a/Source/WebCore/platform/graphics/PlatformDisplay.cpp >+++ b/Source/WebCore/platform/graphics/PlatformDisplay.cpp >@@ -157,10 +157,10 @@ PlatformDisplay::~PlatformDisplay() > } > > #if USE(EGL) || USE(GLX) >-GLContext* PlatformDisplay::sharingGLContext() >+GLContext* PlatformDisplay::sharingGLContext(uint32_t eglConfigBitsPerPixel) > { > if (!m_sharingGLContext) >- m_sharingGLContext = GLContext::createSharingContext(*this); >+ m_sharingGLContext = GLContext::createSharingContext(*this, eglConfigBitsPerPixel); > return m_sharingGLContext.get(); > } > #endif >diff --git a/Source/WebCore/platform/graphics/PlatformDisplay.h b/Source/WebCore/platform/graphics/PlatformDisplay.h >index 4f2929a6488008a097dd1bad5da93b349db82c72..a07bad6ab51de33f8f70965f4d8a185476f38ba1 100644 >--- a/Source/WebCore/platform/graphics/PlatformDisplay.h >+++ b/Source/WebCore/platform/graphics/PlatformDisplay.h >@@ -62,7 +62,7 @@ public: > virtual Type type() const = 0; > > #if USE(EGL) || USE(GLX) >- WEBCORE_EXPORT GLContext* sharingGLContext(); >+ WEBCORE_EXPORT GLContext* sharingGLContext(uint32_t eglConfigBitsPerPixel = 32); > #endif > > #if USE(EGL) >diff --git a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp b/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp >index 24d06ba02b79f4b76d7922774a0f8cd5e306a0ac..ea0ed53b0f4894790d2a2b527a9f5716ac70486b 100644 >--- a/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp >+++ b/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp >@@ -92,7 +92,7 @@ const char* GLContextEGL::lastErrorString() > return errorString(eglGetError()); > } > >-bool GLContextEGL::getEGLConfig(EGLDisplay display, EGLConfig* config, EGLSurfaceType surfaceType) >+bool GLContextEGL::getEGLConfig(EGLDisplay display, EGLConfig* config, EGLSurfaceType surfaceType, uint32_t bitsPerPixel) > { > EGLint attributeList[] = { > #if USE(OPENGL_ES) >@@ -100,15 +100,23 @@ bool GLContextEGL::getEGLConfig(EGLDisplay display, EGLConfig* config, EGLSurfac > #else > EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, > #endif >- EGL_RED_SIZE, 8, >- EGL_GREEN_SIZE, 8, >- EGL_BLUE_SIZE, 8, >- EGL_STENCIL_SIZE, 8, >- EGL_ALPHA_SIZE, 8, >+ EGL_RED_SIZE, 1, >+ EGL_GREEN_SIZE, 1, >+ EGL_BLUE_SIZE, 1, >+ EGL_ALPHA_SIZE, 1, >+ EGL_STENCIL_SIZE, 1, > EGL_SURFACE_TYPE, EGL_NONE, >+ EGL_DEPTH_SIZE, 0, >+ EGL_SAMPLES, 0, > EGL_NONE > }; > >+ EGLint bufferSize = bitsPerPixel; >+ if (bufferSize == 16) { >+ attributeList[9] = 0; >+ attributeList[11] = 0; >+ } >+ > switch (surfaceType) { > case GLContextEGL::PbufferSurface: > attributeList[13] = EGL_PBUFFER_BIT; >@@ -122,15 +130,36 @@ bool GLContextEGL::getEGLConfig(EGLDisplay display, EGLConfig* config, EGLSurfac > break; > } > >+ EGLint count; >+ if (!eglGetConfigs(display, nullptr, 0, &count) || !count) >+ return false; >+ >+ EGLConfig* configs = reinterpret_cast<EGLConfig*>(fastCalloc(sizeof(EGLConfig), count)); > EGLint numberConfigsReturned; >- return eglChooseConfig(display, attributeList, config, 1, &numberConfigsReturned) && numberConfigsReturned; >+ if (!eglChooseConfig(display, attributeList, configs, count, &numberConfigsReturned) || !numberConfigsReturned) >+ return false; >+ >+ EGLint size; >+ for (EGLint i = 0; i < numberConfigsReturned; i++) { >+ eglGetConfigAttrib(display, configs[i], EGL_BUFFER_SIZE, &size); >+ if (bufferSize == size) { >+ *config = configs[i]; >+ fastFree(configs); >+ return true; >+ } >+ } >+ fastFree(configs); >+ return false; > } > >-std::unique_ptr<GLContextEGL> GLContextEGL::createWindowContext(GLNativeWindowType window, PlatformDisplay& platformDisplay, EGLContext sharingContext) >+std::unique_ptr<GLContextEGL> GLContextEGL::createWindowContext(GLNativeWindowType window, PlatformDisplay& platformDisplay, EGLContext sharingContext, uint32_t bitsPerPixel) > { > EGLDisplay display = platformDisplay.eglDisplay(); > EGLConfig config; >- if (!getEGLConfig(display, &config, WindowSurface)) { >+#if !PLATFORM(WPE) >+ bitsPerPixel = 32; >+#endif >+ if (!getEGLConfig(display, &config, WindowSurface, bitsPerPixel)) { > WTFLogAlways("Cannot obtain EGL window context configuration: %s\n", lastErrorString()); > return nullptr; > } >@@ -192,7 +221,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createPbufferContext(PlatformDisplay > return std::unique_ptr<GLContextEGL>(new GLContextEGL(platformDisplay, context, surface, PbufferSurface)); > } > >-std::unique_ptr<GLContextEGL> GLContextEGL::createSurfacelessContext(PlatformDisplay& platformDisplay, EGLContext sharingContext) >+std::unique_ptr<GLContextEGL> GLContextEGL::createSurfacelessContext(PlatformDisplay& platformDisplay, EGLContext sharingContext, uint32_t bitsPerPixel) > { > EGLDisplay display = platformDisplay.eglDisplay(); > if (display == EGL_NO_DISPLAY) { >@@ -206,8 +235,11 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createSurfacelessContext(PlatformDis > return nullptr; > } > >+#if !PLATFORM(WPE) >+ bitsPerPixel = 32; >+#endif > EGLConfig config; >- if (!getEGLConfig(display, &config, Surfaceless)) { >+ if (!getEGLConfig(display, &config, Surfaceless, bitsPerPixel)) { > WTFLogAlways("Cannot obtain EGL surfaceless configuration: %s\n", lastErrorString()); > return nullptr; > } >@@ -221,7 +253,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createSurfacelessContext(PlatformDis > return std::unique_ptr<GLContextEGL>(new GLContextEGL(platformDisplay, context, EGL_NO_SURFACE, Surfaceless)); > } > >-std::unique_ptr<GLContextEGL> GLContextEGL::createContext(GLNativeWindowType window, PlatformDisplay& platformDisplay) >+std::unique_ptr<GLContextEGL> GLContextEGL::createContext(GLNativeWindowType window, PlatformDisplay& platformDisplay, uint32_t bitsPerPixel) > { > if (platformDisplay.eglDisplay() == EGL_NO_DISPLAY) { > WTFLogAlways("Cannot create EGL context: invalid display (last error: %s)\n", lastErrorString()); >@@ -237,10 +269,10 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createContext(GLNativeWindowType win > return nullptr; > } > >- EGLContext eglSharingContext = platformDisplay.sharingGLContext() ? static_cast<GLContextEGL*>(platformDisplay.sharingGLContext())->m_context : EGL_NO_CONTEXT; >- auto context = window ? createWindowContext(window, platformDisplay, eglSharingContext) : nullptr; >+ EGLContext eglSharingContext = platformDisplay.sharingGLContext(bitsPerPixel) ? static_cast<GLContextEGL*>(platformDisplay.sharingGLContext())->m_context : EGL_NO_CONTEXT; >+ auto context = window ? createWindowContext(window, platformDisplay, eglSharingContext, bitsPerPixel) : nullptr; > if (!context) >- context = createSurfacelessContext(platformDisplay, eglSharingContext); >+ context = createSurfacelessContext(platformDisplay, eglSharingContext, bitsPerPixel); > if (!context) { > #if PLATFORM(X11) > if (platformDisplay.type() == PlatformDisplay::Type::X11) >@@ -252,7 +284,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createContext(GLNativeWindowType win > #endif > #if PLATFORM(WPE) > if (platformDisplay.type() == PlatformDisplay::Type::WPE) >- context = createWPEContext(platformDisplay, eglSharingContext); >+ context = createWPEContext(platformDisplay, eglSharingContext, bitsPerPixel); > #endif > } > if (!context) >@@ -261,7 +293,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createContext(GLNativeWindowType win > return context; > } > >-std::unique_ptr<GLContextEGL> GLContextEGL::createSharingContext(PlatformDisplay& platformDisplay) >+std::unique_ptr<GLContextEGL> GLContextEGL::createSharingContext(PlatformDisplay& platformDisplay, uint32_t bitsPerPixel) > { > if (platformDisplay.eglDisplay() == EGL_NO_DISPLAY) { > WTFLogAlways("Cannot create EGL sharing context: invalid display (last error: %s)", lastErrorString()); >@@ -277,7 +309,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createSharingContext(PlatformDisplay > return nullptr; > } > >- auto context = createSurfacelessContext(platformDisplay); >+ auto context = createSurfacelessContext(platformDisplay, nullptr, bitsPerPixel); > if (!context) { > #if PLATFORM(X11) > if (platformDisplay.type() == PlatformDisplay::Type::X11) >@@ -289,7 +321,7 @@ std::unique_ptr<GLContextEGL> GLContextEGL::createSharingContext(PlatformDisplay > #endif > #if PLATFORM(WPE) > if (platformDisplay.type() == PlatformDisplay::Type::WPE) >- context = createWPEContext(platformDisplay); >+ context = createWPEContext(platformDisplay, nullptr, bitsPerPixel); > #endif > } > if (!context) >diff --git a/Source/WebCore/platform/graphics/egl/GLContextEGL.h b/Source/WebCore/platform/graphics/egl/GLContextEGL.h >index cbd6341fe5d711d08c7474cac4b563ddcd97ccff..7ed4fea9d9ef70d1b31984341653ee9148753333 100644 >--- a/Source/WebCore/platform/graphics/egl/GLContextEGL.h >+++ b/Source/WebCore/platform/graphics/egl/GLContextEGL.h >@@ -46,8 +46,8 @@ namespace WebCore { > class GLContextEGL final : public GLContext { > WTF_MAKE_NONCOPYABLE(GLContextEGL); > public: >- static std::unique_ptr<GLContextEGL> createContext(GLNativeWindowType, PlatformDisplay&); >- static std::unique_ptr<GLContextEGL> createSharingContext(PlatformDisplay&); >+ static std::unique_ptr<GLContextEGL> createContext(GLNativeWindowType, PlatformDisplay&, uint32_t bitsPerPixel = 32); >+ static std::unique_ptr<GLContextEGL> createSharingContext(PlatformDisplay&, uint32_t bitsPerPixel = 32); > > static const char* errorString(int statusCode); > static const char* lastErrorString(); >@@ -87,9 +87,9 @@ private: > void destroyWPETarget(); > #endif > >- static std::unique_ptr<GLContextEGL> createWindowContext(GLNativeWindowType, PlatformDisplay&, EGLContext sharingContext = nullptr); >+ static std::unique_ptr<GLContextEGL> createWindowContext(GLNativeWindowType, PlatformDisplay&, EGLContext sharingContext = nullptr, uint32_t bitsPerPixel = 32); > static std::unique_ptr<GLContextEGL> createPbufferContext(PlatformDisplay&, EGLContext sharingContext = nullptr); >- static std::unique_ptr<GLContextEGL> createSurfacelessContext(PlatformDisplay&, EGLContext sharingContext = nullptr); >+ static std::unique_ptr<GLContextEGL> createSurfacelessContext(PlatformDisplay&, EGLContext sharingContext = nullptr, uint32_t bitsPerPixel = 42); > #if PLATFORM(X11) > static std::unique_ptr<GLContextEGL> createPixmapContext(PlatformDisplay&, EGLContext sharingContext = nullptr); > static EGLSurface createWindowSurfaceX11(EGLDisplay, EGLConfig, GLNativeWindowType); >@@ -99,11 +99,11 @@ private: > static EGLSurface createWindowSurfaceWayland(EGLDisplay, EGLConfig, GLNativeWindowType); > #endif > #if USE(LIBWPE) >- static std::unique_ptr<GLContextEGL> createWPEContext(PlatformDisplay&, EGLContext sharingContext = nullptr); >+ static std::unique_ptr<GLContextEGL> createWPEContext(PlatformDisplay&, EGLContext sharingContext = nullptr, uint32_t bitsPerPixel = 32); > static EGLSurface createWindowSurfaceWPE(EGLDisplay, EGLConfig, GLNativeWindowType); > #endif > >- static bool getEGLConfig(EGLDisplay, EGLConfig*, EGLSurfaceType); >+ static bool getEGLConfig(EGLDisplay, EGLConfig*, EGLSurfaceType, uint32_t bitsPerPixel = 32); > > EGLContext m_context { nullptr }; > EGLSurface m_surface { nullptr }; >diff --git a/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp b/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp >index d98809fe7ad559f91475967b9cb4015f373666d2..db8e3b592ce76c3f09ce5a10e509a4f8a354bd6b 100644 >--- a/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp >+++ b/Source/WebCore/platform/graphics/egl/GLContextEGLLibWPE.cpp >@@ -50,11 +50,11 @@ EGLSurface GLContextEGL::createWindowSurfaceWPE(EGLDisplay display, EGLConfig co > return eglCreateWindowSurface(display, config, reinterpret_cast<EGLNativeWindowType>(window), nullptr); > } > >-std::unique_ptr<GLContextEGL> GLContextEGL::createWPEContext(PlatformDisplay& platformDisplay, EGLContext sharingContext) >+std::unique_ptr<GLContextEGL> GLContextEGL::createWPEContext(PlatformDisplay& platformDisplay, EGLContext sharingContext, uint32_t bitsPerPixel) > { > EGLDisplay display = platformDisplay.eglDisplay(); > EGLConfig config; >- if (!getEGLConfig(display, &config, WindowSurface)) { >+ if (!getEGLConfig(display, &config, WindowSurface, bitsPerPixel)) { > WTFLogAlways("Cannot obtain EGL WPE context configuration: %s\n", lastErrorString()); > return nullptr; > } >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >index 7522f84ea8f8a6823bb921ffc3f05cfbd87eb581..bec2f98eda12a9f8b2c83a7029fea7f03c7006f4 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp >@@ -87,7 +87,8 @@ void ThreadedCompositor::createGLContext() > > ASSERT(m_nativeSurfaceHandle); > >- m_context = GLContext::createContextForWindow(reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle), &PlatformDisplay::sharedDisplayForCompositing()); >+ uint32_t eglConfigBitsPerPixel = m_client.eglConfigBitsPerPixel(); >+ m_context = GLContext::createContextForWindow(reinterpret_cast<GLNativeWindowType>(m_nativeSurfaceHandle), &PlatformDisplay::sharedDisplayForCompositing(), eglConfigBitsPerPixel); > if (!m_context) > return; > >diff --git a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h >index 6d7053850dad57a164f19e9186f4fa2a6a866aff..e5545c4244e0fc9102172e493f4b16a9f4368604 100644 >--- a/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h >+++ b/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h >@@ -56,6 +56,8 @@ public: > virtual uint64_t nativeSurfaceHandleForCompositing() = 0; > virtual void didDestroyGLContext() = 0; > >+ virtual uint32_t eglConfigBitsPerPixel() = 0; >+ > virtual void resize(const WebCore::IntSize&) = 0; > virtual void willRenderFrame() = 0; > virtual void didRenderFrame() = 0; >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 74a122c5b77fc5d41a28891ca0a53df5dec9fafe..0001441b9148648e8d7fffa47575ac0c709bcb9c 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1559,6 +1559,13 @@ MousemoveEventHandlingPreventsDefaultEnabled: > category: internal > condition: ENABLE(TOUCH_EVENTS) > >+EglConfigBitsPerPixel: >+ type: uint32_t >+ defaultValue: 32 >+ condition: PLATFORM(WPE) >+ >+# webcoreName: eglConfigBitsPerPixel >+ > # Deprecated > > ICECandidateFilteringEnabled: >diff --git a/Source/WebKit/UIProcess/API/C/WKPreferences.cpp b/Source/WebKit/UIProcess/API/C/WKPreferences.cpp >index 3051330c0c6732395a3ebe5db820279fc158f381..a25717ed81677a24202c388a035dd5435825ff01 100644 >--- a/Source/WebKit/UIProcess/API/C/WKPreferences.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKPreferences.cpp >@@ -2109,3 +2109,15 @@ bool WKPreferencesGetCaptureVideoInUIProcessEnabled(WKPreferencesRef preferences > { > return toImpl(preferencesRef)->captureVideoInUIProcessEnabled(); > } >+ >+#if PLATFORM(WPE) >+void WKPreferencesSetEGLConfigBitsPerPixel(WKPreferencesRef preferencesRef, int bitsPerPixel) >+{ >+ toImpl(preferencesRef)->setEglConfigBitsPerPixel(bitsPerPixel); >+} >+ >+bool WKPreferencesGetEGLConfigBitsPerPixel(WKPreferencesRef preferencesRef) >+{ >+ return toImpl(preferencesRef)->eglConfigBitsPerPixel(); >+} >+#endif >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp b/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp >index 03654dd0481eb7f357eca537f69813eb2803349b..6acab4c99c607020b64c47a73eabc7f2f8292aa9 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp >@@ -167,6 +167,9 @@ enum { > PROP_ENABLE_BACK_FORWARD_NAVIGATION_GESTURES, > #endif > PROP_ENABLE_JAVASCRIPT_MARKUP, >+#if PLATFORM(WPE) >+ PROP_EGL_CONFIG_BITS_PER_PIXEL, >+#endif > }; > > static void webKitSettingsDispose(GObject* object) >@@ -393,6 +396,11 @@ static void webKitSettingsSetProperty(GObject* object, guint propId, const GValu > case PROP_ENABLE_JAVASCRIPT_MARKUP: > webkit_settings_set_enable_javascript_markup(settings, g_value_get_boolean(value)); > break; >+#if PLATFORM(WPE) >+ case PROP_EGL_CONFIG_BITS_PER_PIXEL: >+ webkit_settings_set_egl_config_bits_per_pixel(settings, g_value_get_int(value)); >+ break; >+#endif > default: > G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec); > break; >@@ -578,6 +586,11 @@ static void webKitSettingsGetProperty(GObject* object, guint propId, GValue* val > case PROP_ENABLE_JAVASCRIPT_MARKUP: > g_value_set_boolean(value, webkit_settings_get_enable_javascript_markup(settings)); > break; >+#if PLATFORM(WPE) >+ case PROP_EGL_CONFIG_BITS_PER_PIXEL: >+ g_value_set_int(value, webkit_settings_get_egl_config_bits_per_pixel(settings)); >+ break; >+#endif > default: > G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec); > break; >@@ -1493,6 +1506,22 @@ static void webkit_settings_class_init(WebKitSettingsClass* klass) > _("Enable JavaScript in document markup."), > TRUE, > readWriteConstructParamFlags)); >+ >+#if PLATFORM(WPE) >+ /** >+ * WebKitSettings:egl-config-bits-per-pixel: >+ * >+ * Configure the EGL configuration pixel resolution. The default is 32 bits per pixel. >+ * >+ * Since: 2.26 >+ */ >+ g_object_class_install_property(gObjectClass, >+ PROP_EGL_CONFIG_BITS_PER_PIXEL, >+ g_param_spec_int("egl-config-bits-per-pixel", >+ _("EGL configuration bits per pixel"), >+ _("EGL configuration bits per pixel"), >+ 16, 32, 32, readWriteConstructParamFlags)); >+#endif // PLATFORM(WPE) > } > > WebPreferences* webkitSettingsGetPreferences(WebKitSettings* settings) >@@ -3674,3 +3703,44 @@ void webkit_settings_set_enable_javascript_markup(WebKitSettings* settings, gboo > priv->preferences->setJavaScriptMarkupEnabled(enabled); > g_object_notify(G_OBJECT(settings), "enable-javascript-markup"); > } >+ >+#if PLATFORM(WPE) >+/** >+ * webkit_settings_get_egl_config_bits_per_pixel: >+ * @settings: a #WebKitSettings >+ * >+ * Get the #WebKitSettings:egl-config-bits-per-pixel property. >+ * >+ * Returns: A %gint >+ * >+ * Since: 2.26 >+ */ >+gint webkit_settings_get_egl_config_bits_per_pixel(WebKitSettings* settings) >+{ >+ g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 32); >+ >+ return settings->priv->preferences->eglConfigBitsPerPixel(); >+} >+ >+/** >+ * webkit_settings_set_egl_config_bits_per_pixel: >+ * @settings: a #WebKitSettings >+ * @bits_per_pixel: Value to be set >+ * >+ * Set the #WebKitSettings:egl-config-bits-per-pixel property. >+ * >+ * Since: 2.26 >+ */ >+void webkit_settings_set_egl_config_bits_per_pixel(WebKitSettings* settings, gint bitsPerPixel) >+{ >+ g_return_if_fail(WEBKIT_IS_SETTINGS(settings)); >+ >+ WebKitSettingsPrivate* priv = settings->priv; >+ gint currentValue = priv->preferences->eglConfigBitsPerPixel(); >+ if (currentValue == bitsPerPixel) >+ return; >+ >+ priv->preferences->setEglConfigBitsPerPixel(bitsPerPixel); >+ g_object_notify(G_OBJECT(settings), "egl-config-bits-per-pixel"); >+} >+#endif >diff --git a/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h b/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h >index a7921abfed187fa3bcb1c60918dcc4b66847aa7c..27a63c71dfa2f44466104260d5cf7e4361bd34dc 100644 >--- a/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h >+++ b/Source/WebKit/UIProcess/API/wpe/WebKitSettings.h >@@ -449,6 +449,13 @@ WEBKIT_API void > webkit_settings_set_enable_javascript_markup (WebKitSettings *settings, > gboolean enabled); > >+WEBKIT_API gint >+webkit_settings_get_egl_config_bits_per_pixel (WebKitSettings *settings); >+ >+WEBKIT_API void >+webkit_settings_set_egl_config_bits_per_pixel (WebKitSettings *settings, >+ gint bits_per_pixel); >+ > G_END_DECLS > > #endif /* WebKitSettings_h */ >diff --git a/Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt b/Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt >index a5ecfe4637f8f3917af26127face01517f378806..6e0e5b9f20cbdab946a84d749c34c52b39709e26 100644 >--- a/Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt >+++ b/Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt >@@ -469,6 +469,8 @@ webkit_settings_get_allow_file_access_from_file_urls > webkit_settings_set_allow_file_access_from_file_urls > webkit_settings_get_allow_universal_access_from_file_urls > webkit_settings_set_allow_universal_access_from_file_urls >+webkit_settings_get_egl_config_bits_per_pixel >+webkit_settings_set_egl_config_bits_per_pixel > > <SUBSECTION Standard> > WebKitSettingsClass >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp >index 823b7fa2ac7597a3aeab274431bc0cc9b92908c9..13ecae2a14c45953ea936ee664ed4cd2cd6fa771 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp >@@ -136,6 +136,15 @@ void ThreadedCoordinatedLayerTreeHost::didDestroyGLContext() > m_surface->finalize(); > } > >+uint32_t ThreadedCoordinatedLayerTreeHost::eglConfigBitsPerPixel() >+{ >+#if PLATFORM(WPE) >+ return m_webPage.eglConfigBitsPerPixel(); >+#else >+ return 32; >+#endif >+} >+ > void ThreadedCoordinatedLayerTreeHost::willRenderFrame() > { > if (m_surface) >diff --git a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h >index b784681679b227bb81227745e1b768e1a3b063cd..4fdc2850fd12f0c00ae816a064166fa93f32c00c 100644 >--- a/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h >+++ b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h >@@ -91,6 +91,11 @@ private: > m_layerTreeHost.didDestroyGLContext(); > } > >+ uint32_t eglConfigBitsPerPixel() override >+ { >+ return m_layerTreeHost.eglConfigBitsPerPixel(); >+ } >+ > void resize(const WebCore::IntSize& size) > { > if (m_layerTreeHost.m_surface) >@@ -135,6 +140,7 @@ private: > > uint64_t nativeSurfaceHandleForCompositing(); > void didDestroyGLContext(); >+ uint32_t eglConfigBitsPerPixel(); > void willRenderFrame(); > void didRenderFrame(); > void requestDisplayRefreshMonitorUpdate(); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 085d82a8e64d97ab6219948000ab9fc7a9b78fb0..e3f3831421704b91f856bd7d226270a8787ae31f 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -3472,6 +3472,10 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) > > settings.setLayoutViewportHeightExpansionFactor(store.getDoubleValueForKey(WebPreferencesKey::layoutViewportHeightExpansionFactorKey())); > >+#if PLATFORM(WPE) >+ m_eglConfigBitsPerPixel = store.getUInt32ValueForKey(WebPreferencesKey::eglConfigBitsPerPixelKey()); >+#endif >+ > if (m_drawingArea) > m_drawingArea->updatePreferences(store); > } >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 1dd2bf7d4b5adf47efc9a16d60d72baf2cc49778..01cfa4a482ff4b17c36f08d822aed14c4c9b6601 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -1126,6 +1126,7 @@ public: > > #if PLATFORM(WPE) > int releaseHostFileDescriptor() { return m_hostFileDescriptor.releaseFileDescriptor(); } >+ uint32_t eglConfigBitsPerPixel() const { return m_eglConfigBitsPerPixel; } > #endif > > void updateCurrentModifierState(OptionSet<WebCore::PlatformEvent::Modifier> modifiers); >@@ -1829,6 +1830,7 @@ private: > > #if PLATFORM(WPE) > IPC::Attachment m_hostFileDescriptor; >+ uint32_t m_eglConfigBitsPerPixel { 32 }; > #endif > > HashMap<String, RefPtr<WebURLSchemeHandlerProxy>> m_schemeToURLSchemeHandlerProxyMap; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 84fe3d6f546a00479cb1b4907ca1cf3d7c016267..ffda2acb57b8ded131b3972a228707eb107685dc 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,14 @@ >+2019-02-19 Philippe Normand <pnormand@igalia.com> >+ >+ [WPE][EGL] Runtime support for 16 bpp EGL configurations >+ https://bugs.webkit.org/show_bug.cgi?id=194817 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * MiniBrowser/wpe/main.cpp: >+ (main): Add WPE_EGL_BPP environment variable support so that the >+ egl-config-bits-per-pixel setting can be easily tested. >+ > 2019-02-19 Pablo Saavedra <psaavedra@igalia.com> > > pytest is not correctly auto-installed >diff --git a/Tools/MiniBrowser/wpe/main.cpp b/Tools/MiniBrowser/wpe/main.cpp >index 131a0f387090b347752408f9ea416dba180affaa..3db8bee752fd42af96b69d937c77e7c7d6ac01d6 100644 >--- a/Tools/MiniBrowser/wpe/main.cpp >+++ b/Tools/MiniBrowser/wpe/main.cpp >@@ -183,12 +183,16 @@ int main(int argc, char *argv[]) > const char* singleprocess = g_getenv("MINIBROWSER_SINGLEPROCESS"); > webkit_web_context_set_process_model(webContext, (singleprocess && *singleprocess) ? > WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS : WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); >+ int eglConfigBitsPerPixel = 32; >+ if (const char* eglConfigBitsPerPixelEnvironmentVariable = g_getenv("WPE_EGL_BPP")) >+ eglConfigBitsPerPixel = static_cast<int>(g_ascii_strtoll(eglConfigBitsPerPixelEnvironmentVariable, NULL, 0)); > > auto* settings = webkit_settings_new_with_settings( > "enable-developer-extras", TRUE, > "enable-webgl", TRUE, > "enable-media-stream", TRUE, > "enable-encrypted-media", TRUE, >+ "egl-config-bits-per-pixel", eglConfigBitsPerPixel, > nullptr); > > auto* backendPtr = backend.get();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194817
:
362385
|
362894
|
362895
|
362974
|
362975
|
362978