Title: [290064] trunk/Source/WebCore
- Revision
- 290064
- Author
- [email protected]
- Date
- 2022-02-17 13:13:57 -0800 (Thu, 17 Feb 2022)
Log Message
[GTK][WPE] Make proper ANGLE context configuration for some of the expected features
https://bugs.webkit.org/show_bug.cgi?id=236664
Patch by Alejandro G. Castro <[email protected]> on 2022-02-17
Reviewed by Žan Doberšek.
Add some missing ANGLE GL context configuration options to respect
some of the expected requirements of the WebGL standard.
Fixing multiple layout tests for the ANGLE backend, we can not
modify them for the moment because this is not the default option
in the compilation.
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
(Nicosia::GCGLANGLELayer::ANGLEContext::createContext): Add a new
parameter to detect WebGL2 context and modify context configuration.
(Nicosia::GCGLANGLELayer::GCGLANGLELayer): Ditto.
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h: Ditto.
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::GraphicsContextGLANGLE): Enable
GL_OES_EGL_image required for the coordinated graphics texture rendering.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (290063 => 290064)
--- trunk/Source/WebCore/ChangeLog 2022-02-17 21:12:23 UTC (rev 290063)
+++ trunk/Source/WebCore/ChangeLog 2022-02-17 21:13:57 UTC (rev 290064)
@@ -1,3 +1,26 @@
+2022-02-17 Alejandro G. Castro <[email protected]>
+
+ [GTK][WPE] Make proper ANGLE context configuration for some of the expected features
+ https://bugs.webkit.org/show_bug.cgi?id=236664
+
+ Reviewed by Žan Doberšek.
+
+ Add some missing ANGLE GL context configuration options to respect
+ some of the expected requirements of the WebGL standard.
+
+ Fixing multiple layout tests for the ANGLE backend, we can not
+ modify them for the moment because this is not the default option
+ in the compilation.
+
+ * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp:
+ (Nicosia::GCGLANGLELayer::ANGLEContext::createContext): Add a new
+ parameter to detect WebGL2 context and modify context configuration.
+ (Nicosia::GCGLANGLELayer::GCGLANGLELayer): Ditto.
+ * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h: Ditto.
+ * platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
+ (WebCore::GraphicsContextGLANGLE::GraphicsContextGLANGLE): Enable
+ GL_OES_EGL_image required for the coordinated graphics texture rendering.
+
2022-02-17 Aditya Keerthi <[email protected]>
[macOS] Light appearance text fields are invisible in Increased Contrast mode
Modified: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp (290063 => 290064)
--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp 2022-02-17 21:12:23 UTC (rev 290063)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp 2022-02-17 21:13:57 UTC (rev 290064)
@@ -121,7 +121,7 @@
return errorString(EGL_GetError());
}
-std::unique_ptr<GCGLANGLELayer::ANGLEContext> GCGLANGLELayer::ANGLEContext::createContext()
+std::unique_ptr<GCGLANGLELayer::ANGLEContext> GCGLANGLELayer::ANGLEContext::createContext(bool isForWebGL2)
{
EGLDisplay display = EGL_GetDisplay(EGL_DEFAULT_DISPLAY);
if (display == EGL_NO_DISPLAY)
@@ -144,6 +144,8 @@
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
+ EGL_DEPTH_SIZE, 0,
+ EGL_STENCIL_SIZE, 0,
EGL_NONE
};
EGLint numberConfigsReturned = 0;
@@ -161,12 +163,31 @@
}
std::vector<EGLint> contextAttributes;
- contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION);
- contextAttributes.push_back(2);
+ if (isForWebGL2) {
+ contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION);
+ contextAttributes.push_back(3);
+ } else {
+ contextAttributes.push_back(EGL_CONTEXT_CLIENT_VERSION);
+ contextAttributes.push_back(2);
+ // ANGLE will upgrade the context to ES3 automatically unless this is specified.
+ contextAttributes.push_back(EGL_CONTEXT_OPENGL_BACKWARDS_COMPATIBLE_ANGLE);
+ contextAttributes.push_back(EGL_FALSE);
+ }
contextAttributes.push_back(EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE);
contextAttributes.push_back(EGL_TRUE);
- contextAttributes.push_back(EGL_EXTENSIONS_ENABLED_ANGLE);
+
+ // WebGL requires that all resources are cleared at creation.
+ contextAttributes.push_back(EGL_ROBUST_RESOURCE_INITIALIZATION_ANGLE);
contextAttributes.push_back(EGL_TRUE);
+
+ // WebGL doesn't allow client arrays.
+ contextAttributes.push_back(EGL_CONTEXT_CLIENT_ARRAYS_ENABLED_ANGLE);
+ contextAttributes.push_back(EGL_FALSE);
+
+ // WebGL doesn't allow implicit creation of objects on bind.
+ contextAttributes.push_back(EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM);
+ contextAttributes.push_back(EGL_FALSE);
+
if (strstr(displayExtensions, "EGL_ANGLE_power_preference")) {
contextAttributes.push_back(EGL_POWER_PREFERENCE_ANGLE);
// EGL_LOW_POWER_ANGLE is the default. Change to
@@ -231,7 +252,7 @@
GCGLANGLELayer::GCGLANGLELayer(GraphicsContextGLANGLE& context)
: m_context(context)
- , m_angleContext(ANGLEContext::createContext())
+ , m_angleContext(ANGLEContext::createContext(context.m_isForWebGL2))
, m_contentLayer(Nicosia::ContentLayer::create(Nicosia::ContentLayerTextureMapperImpl::createFactory(*this)))
{
}
Modified: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h (290063 => 290064)
--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h 2022-02-17 21:12:23 UTC (rev 290063)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.h 2022-02-17 21:13:57 UTC (rev 290064)
@@ -56,7 +56,7 @@
static const char* errorString(int statusCode);
static const char* lastErrorString();
- static std::unique_ptr<ANGLEContext> createContext();
+ static std::unique_ptr<ANGLEContext> createContext(bool isForWebGL2);
virtual ~ANGLEContext();
bool makeContextCurrent();
Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp (290063 => 290064)
--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp 2022-02-17 21:12:23 UTC (rev 290063)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp 2022-02-17 21:13:57 UTC (rev 290064)
@@ -69,6 +69,10 @@
success = initialize();
ASSERT_UNUSED(success, success);
+ // We require this extension to render into the dmabuf-backed EGLImage.
+ RELEASE_ASSERT(supportsExtension("GL_OES_EGL_image"));
+ GL_RequestExtensionANGLE("GL_OES_EGL_image");
+
validateAttributes();
attributes = contextAttributes(); // They may have changed during validation.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes