Skip to content
Permalink
Browse files
[WinCairo] Enable USE_ANGLE
https://bugs.webkit.org/show_bug.cgi?id=219421

Reviewed by Don Olmstead.

.:

* Source/cmake/OptionsWinCairo.cmake:

Source/ThirdParty/ANGLE:

* CMakeLists.txt: Added entry_points_egl_ext.h to libglesv2_entry_points_headers.

Source/WebCore:

Switch GraphicsContextGLOpenGL implementation from old one
(GraphicsContextGLOpenGLES.cpp) to new one
(GraphicsContextGLANGLE.cpp), which is using ANGLE's internal API
and verification code, for WinCairo port. I will enable WebGL2 for
WinCairo in a follow-up patch.

GL_TEXTURE_RECTANGLE_ANGLE is not available for ANGLE D3D backend.
Use GL_TEXTURE_2D instead.

Add a new class WebCore::ANGLEContext by copying
Nicosia::GCGLANGLELayer::ANGLEContext. It'd be better to merge
them after GTK and WPE will also switch.

* PlatformWin.cmake:
* platform/TextureMapper.cmake:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::compileShader):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/texmap/ANGLEContext.cpp: Added.
(WebCore::ANGLEContext::errorString):
(WebCore::ANGLEContext::lastErrorString):
(WebCore::ANGLEContext::createContext):
(WebCore::ANGLEContext::ANGLEContext):
(WebCore::ANGLEContext::~ANGLEContext):
(WebCore::ANGLEContext::makeContextCurrent):
(WebCore::ANGLEContext::platformContext const):
* platform/graphics/texmap/ANGLEContext.h: Added.
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::isGLES2Compliant const):
(WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer):
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h:

LayoutTests:

* platform/wincairo/TestExpectations:

Canonical link: https://commits.webkit.org/232533@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
fujii committed Dec 16, 2020
1 parent d7d152e commit 00f1936cbbe092a45a86ddfce02d6e94fdba4b20
@@ -1,3 +1,12 @@
2020-12-16 Fujii Hironori <Hironori.Fujii@sony.com>

[WinCairo] Enable USE_ANGLE
https://bugs.webkit.org/show_bug.cgi?id=219421

Reviewed by Don Olmstead.

* Source/cmake/OptionsWinCairo.cmake:

2020-12-13 Don Olmstead <don.olmstead@sony.com>

[CMake] Version of LibPSL not reported
@@ -1,3 +1,12 @@
2020-12-16 Fujii Hironori <Hironori.Fujii@sony.com>

[WinCairo] Enable USE_ANGLE
https://bugs.webkit.org/show_bug.cgi?id=219421

Reviewed by Don Olmstead.

* platform/wincairo/TestExpectations:

2020-12-16 Chris Fleizach <cfleizach@apple.com>

AX: Update list heuristics to include linked lists inside navigation containers
@@ -2131,30 +2131,26 @@ performance-api/paint-timing/paint-timing-with-worker.html [ Failure ]
performance-api/paint-timing/performance-observer-first-contentful-paint.html [ Timeout ]
storage/indexeddb/storage-limit-with-indices.html [ Failure ]
webgl/1.0.3/conformance/canvas/drawingbuffer-test.html [ Skip ] # Timeout
webgl/1.0.3/conformance/context/context-lost-restored.html [ Failure ]
webgl/1.0.3/conformance/context/premultiplyalpha-test.html [ Failure ]
webgl/1.0.3/conformance/extensions/oes-element-index-uint.html [ Failure ]
webgl/1.0.3/conformance/extensions/oes-texture-float-with-video.html [ Skip ] # Timeout
webgl/1.0.3/conformance/extensions/oes-texture-float.html [ Failure ]
webgl/1.0.3/conformance/extensions/oes-texture-half-float-with-video.html [ Skip ] # Timeout
webgl/1.0.3/conformance/extensions/oes-texture-half-float.html [ Failure ]
webgl/1.0.3/conformance/extensions/webgl-compressed-texture-size-limit.html [ Failure ]
webgl/1.0.3/conformance/glsl/bugs/array-of-struct-with-int-first-position.html [ Skip ] # This test makes DumpRenderTree process unable to exit
webgl/1.0.3/conformance/glsl/bugs/long-expressions-should-not-crash.html [ Skip ] # Timeout
webgl/1.0.3/conformance/more/functions/copyTexImage2DBadArgs.html [ Skip ] # Timeout
webgl/1.0.3/conformance/misc/uninitialized-test.html [ Failure ]
webgl/1.0.3/conformance/more/functions/readPixelsBadArgs.html [ Failure ]
webgl/1.0.3/conformance/more/functions/texImage2DHTML.html [ Failure ]
webgl/1.0.3/conformance/more/functions/texSubImage2DHTML.html [ Failure ]
webgl/1.0.3/conformance/more/functions/texSubImage2DHTMLBadArgs.html [ Skip ] # Crash
webgl/1.0.3/conformance/renderbuffers/feedback-loop.html [ Failure ]
webgl/1.0.3/conformance/programs/program-test.html [ Failure ]
webgl/1.0.3/conformance/renderbuffers/framebuffer-object-attachment.html [ Failure ]
webgl/1.0.3/conformance/rendering/point-no-attributes.html [ Failure ]
webgl/1.0.3/conformance/renderbuffers/framebuffer-state-restoration.html [ Failure ]
webgl/1.0.3/conformance/renderbuffers/renderbuffer-initialization.html [ Failure ]
webgl/1.0.3/conformance/textures/default-texture.html [ Failure ]
webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgb565.html [ Skip ] # Timeout
webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba4444.html [ Skip ] # Timeout
webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video-rgba5551.html [ Skip ] # Timeout
webgl/1.0.3/conformance/textures/tex-image-and-sub-image-2d-with-video.html [ Skip ] # Timeout
webgl/1.0.3/conformance/textures/tex-sub-image-2d-bad-args.html [ Skip ] # Crash
webgl/1.0.3/conformance/textures/texture-copying-feedback-loops.html [ Failure ]
webgl/1.0.3/conformance/textures/texture-attachment-formats.html [ Failure ]
webgl/1.0.3/conformance/textures/texture-mips.html [ Failure ]
webgl/1.0.3/conformance/textures/texture-upload-size.html [ Skip ] # Timeout
webgl/conformance/extensions/ext-texture-compression-rgtc.html [ Failure ]
webgl/conformance/extensions/s3tc-and-rgtc.html [ Failure ]
webgl/webgl-vertex-array-object-defined.html [ Failure ]
@@ -170,6 +170,7 @@ endif ()
if (USE_ANGLE_WEBGL)
set(libglesv2_entry_points_headers
src/libGLESv2/entry_points_egl.h
src/libGLESv2/entry_points_egl_ext.h
src/libGLESv2/entry_points_gles_2_0_autogen.h
src/libGLESv2/entry_points_gles_3_0_autogen.h
src/libGLESv2/entry_points_gles_ext_autogen.h
@@ -1,3 +1,12 @@
2020-12-16 Fujii Hironori <Hironori.Fujii@sony.com>

[WinCairo] Enable USE_ANGLE
https://bugs.webkit.org/show_bug.cgi?id=219421

Reviewed by Don Olmstead.

* CMakeLists.txt: Added entry_points_egl_ext.h to libglesv2_entry_points_headers.

2020-12-14 Alex Christensen <achristensen@webkit.org>

Fix build.
@@ -1,3 +1,47 @@
2020-12-16 Fujii Hironori <Hironori.Fujii@sony.com>

[WinCairo] Enable USE_ANGLE
https://bugs.webkit.org/show_bug.cgi?id=219421

Reviewed by Don Olmstead.

Switch GraphicsContextGLOpenGL implementation from old one
(GraphicsContextGLOpenGLES.cpp) to new one
(GraphicsContextGLANGLE.cpp), which is using ANGLE's internal API
and verification code, for WinCairo port. I will enable WebGL2 for
WinCairo in a follow-up patch.

GL_TEXTURE_RECTANGLE_ANGLE is not available for ANGLE D3D backend.
Use GL_TEXTURE_2D instead.

Add a new class WebCore::ANGLEContext by copying
Nicosia::GCGLANGLELayer::ANGLEContext. It'd be better to merge
them after GTK and WPE will also switch.

* PlatformWin.cmake:
* platform/TextureMapper.cmake:
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
(WebCore::GraphicsContextGLOpenGL::compileShader):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
* platform/graphics/texmap/ANGLEContext.cpp: Added.
(WebCore::ANGLEContext::errorString):
(WebCore::ANGLEContext::lastErrorString):
(WebCore::ANGLEContext::createContext):
(WebCore::ANGLEContext::ANGLEContext):
(WebCore::ANGLEContext::~ANGLEContext):
(WebCore::ANGLEContext::makeContextCurrent):
(WebCore::ANGLEContext::platformContext const):
* platform/graphics/texmap/ANGLEContext.h: Added.
* platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::isGLES2Compliant const):
(WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp:
(WebCore::TextureMapperGCGLPlatformLayer::TextureMapperGCGLPlatformLayer):
(WebCore::TextureMapperGCGLPlatformLayer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperGCGLPlatformLayer.h:

2020-12-16 Chris Fleizach <cfleizach@apple.com>

AX: Update list heuristics to include linked lists inside navigation containers
@@ -6,6 +6,7 @@ list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/accessibility/win"
"${WEBCORE_DIR}/page/win"
"${WEBCORE_DIR}/platform/graphics/egl"
"${WEBCORE_DIR}/platform/graphics/angle"
"${WEBCORE_DIR}/platform/graphics/opengl"
"${WEBCORE_DIR}/platform/graphics/opentype"
"${WEBCORE_DIR}/platform/graphics/win"
@@ -37,13 +38,12 @@ list(APPEND WebCore_SOURCES

platform/audio/PlatformMediaSessionManager.cpp

platform/graphics/angle/ExtensionsGLANGLE.cpp
platform/graphics/angle/GraphicsContextGLANGLE.cpp
platform/graphics/angle/TemporaryANGLESetting.cpp

platform/graphics/egl/GLContextEGL.cpp

platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp
platform/graphics/opengl/ExtensionsGLOpenGLES.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp
platform/graphics/opengl/GraphicsContextGLOpenGLPrivate.cpp
platform/graphics/opengl/TemporaryOpenGLSetting.cpp

platform/graphics/opentype/OpenTypeUtilities.cpp
@@ -5,6 +5,8 @@ list(APPEND WebCore_PRIVATE_INCLUDE_DIRECTORIES

list(APPEND WebCore_SOURCES
platform/graphics/nicosia/NicosiaAnimation.cpp

platform/graphics/texmap/ANGLEContext.cpp
platform/graphics/texmap/BitmapTexture.cpp
platform/graphics/texmap/BitmapTexturePool.cpp
platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp
@@ -18,6 +20,8 @@ list(APPEND WebCore_SOURCES

list(APPEND WebCore_PRIVATE_FRAMEWORK_HEADERS
platform/graphics/nicosia/NicosiaAnimation.h

platform/graphics/texmap/ANGLEContext.h
platform/graphics/texmap/BitmapTexture.h
platform/graphics/texmap/ClipStack.h
platform/graphics/texmap/GraphicsLayerTextureMapper.h
@@ -223,20 +223,22 @@ bool GraphicsContextGLOpenGL::reshapeFBOs(const IntSize& size)
gl::BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
} else
gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, drawingBufferTextureTarget(), m_texture, 0);
#elif PLATFORM(GTK)
gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_texture);
gl::TexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE_ANGLE, m_texture, 0);
#else
GLenum textureTarget = drawingBufferTextureTarget();
GLuint internalColorFormat = textureTarget == GL_TEXTURE_2D ? colorFormat : m_internalColorFormat;
gl::BindTexture(textureTarget, m_texture);
gl::TexImage2D(textureTarget, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
gl::FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureTarget, m_texture, 0);
#if USE(COORDINATED_GRAPHICS)
if (m_compositorTexture) {
gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_compositorTexture);
gl::TexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, 0);
gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, m_intermediateTexture);
gl::TexImage2D(GL_TEXTURE_RECTANGLE_ANGLE, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
gl::BindTexture(GL_TEXTURE_RECTANGLE_ANGLE, 0);
gl::BindTexture(textureTarget, m_compositorTexture);
gl::TexImage2D(textureTarget, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
gl::BindTexture(textureTarget, 0);
gl::BindTexture(textureTarget, m_intermediateTexture);
gl::TexImage2D(textureTarget, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
gl::BindTexture(textureTarget, 0);
}
#else
#error FIXME: Port to non-Cocoa platforms.
#endif
#endif // PLATFORM(COCOA)

attachDepthAndStencilBufferIfNeeded(internalDepthStencilFormat, width, height);
@@ -1070,12 +1072,16 @@ void GraphicsContextGLOpenGL::compileShader(PlatformGLObject shader)
if (!makeContextCurrent())
return;

#if !PLATFORM(WIN)
// We need the ANGLE_texture_rectangle extension to support IOSurface
// backbuffers, but we don't want it exposed to WebGL user shaders.
// Temporarily disable it during shader compilation.
gl::Disable(GL_TEXTURE_RECTANGLE_ANGLE);
#endif
gl::CompileShader(shader);
#if !PLATFORM(WIN)
gl::Enable(GL_TEXTURE_RECTANGLE_ANGLE);
#endif
}

void GraphicsContextGLOpenGL::compileShaderDirect(PlatformGLObject shader)
@@ -102,12 +102,14 @@ class WEBCORE_EXPORT GraphicsContextGLOpenGL final : public GraphicsContextGL
CALayer* platformLayer() const final { return reinterpret_cast<CALayer*>(m_webGLLayer.get()); }
PlatformGraphicsContextGLDisplay platformDisplay() const { return m_displayObj; }
PlatformGraphicsContextGLConfig platformConfig() const { return m_configObj; }
static GCGLenum drawingBufferTextureTarget();
static GCGLenum drawingBufferTextureTargetQuery();
static GCGLint EGLDrawingBufferTextureTarget();
#else
PlatformLayer* platformLayer() const final;
#endif
#if USE(ANGLE)
static GCGLenum drawingBufferTextureTarget();
#endif

#if PLATFORM(IOS_FAMILY)
enum class ReleaseBehavior {

0 comments on commit 00f1936

Please sign in to comment.