Modified: trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp (290979 => 290980)
--- trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp 2022-03-08 08:53:32 UTC (rev 290979)
+++ trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp 2022-03-08 08:55:33 UTC (rev 290980)
@@ -550,11 +550,13 @@
if (contextAttributes().antialias)
resolveMultisamplingIfNecessary();
+#if USE(TEXTURE_MAPPER)
+ std::swap(m_texture, m_compositorTexture);
#if USE(COORDINATED_GRAPHICS)
- std::swap(m_texture, m_compositorTexture);
std::swap(m_texture, m_intermediateTexture);
std::swap(m_textureBacking, m_compositorTextureBacking);
std::swap(m_textureBacking, m_intermediateTextureBacking);
+#endif
GL_BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
GL_FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, drawingBufferTextureTarget(), m_texture, 0);
Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp (290979 => 290980)
--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp 2022-03-08 08:53:32 UTC (rev 290979)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp 2022-03-08 08:55:33 UTC (rev 290980)
@@ -197,7 +197,6 @@
GL_GenFramebuffers(1, &m_fbo);
GL_BindFramebuffer(GL_FRAMEBUFFER, m_fbo);
-#if USE(COORDINATED_GRAPHICS)
GL_GenTextures(1, &m_compositorTexture);
GL_BindTexture(textureTarget, m_compositorTexture);
GL_TexParameterf(textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -205,6 +204,7 @@
GL_TexParameteri(textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
GL_TexParameteri(textureTarget, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+#if USE(COORDINATED_GRAPHICS)
GL_GenTextures(1, &m_intermediateTexture);
GL_BindTexture(textureTarget, m_intermediateTexture);
GL_TexParameterf(textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -321,10 +321,8 @@
ASSERT_UNUSED(success, success);
if (m_texture)
GL_DeleteTextures(1, &m_texture);
-#if USE(COORDINATED_GRAPHICS)
if (m_compositorTexture)
GL_DeleteTextures(1, &m_compositorTexture);
-#endif
auto attributes = contextAttributes();
@@ -405,14 +403,17 @@
else
GL_TexImage2D(textureTarget, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
}
-#endif
GL_BindTexture(textureTarget, m_texture);
-#if USE(COORDINATED_GRAPHICS)
if (m_textureBacking && m_textureBacking->image())
GL_EGLImageTargetTexture2DOES(textureTarget, m_textureBacking->image());
else
+ GL_TexImage2D(textureTarget, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
+#else
+ GL_BindTexture(textureTarget, m_compositorTexture);
+ GL_TexImage2D(textureTarget, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
+ GL_BindTexture(textureTarget, m_texture);
+ GL_TexImage2D(textureTarget, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
#endif
- GL_TexImage2D(textureTarget, 0, internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
GL_FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureTarget, m_texture, 0);
return true;
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp (290979 => 290980)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp 2022-03-08 08:53:32 UTC (rev 290979)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGCGLPlatformLayer.cpp 2022-03-08 08:55:33 UTC (rev 290980)
@@ -45,27 +45,20 @@
void TextureMapperGCGLPlatformLayer::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
{
- m_context.markLayerComposited();
+ GLContext* previousActiveContext = GLContext::current();
-#if USE(TEXTURE_MAPPER_GL)
- auto attrs = m_context.contextAttributes();
- ASSERT(m_context.m_state.boundReadFBO == m_context.m_state.boundDrawFBO);
- if (attrs.antialias && m_context.m_state.boundDrawFBO == m_context.m_multisampleFBO) {
- GLContext* previousActiveContext = GLContext::current();
- m_context.makeContextCurrent();
+ m_context.prepareTexture();
- m_context.resolveMultisamplingIfNecessary();
- GL_BindFramebuffer(GL_FRAMEBUFFER, m_context.m_state.boundDrawFBO);
+ if (previousActiveContext)
+ previousActiveContext->makeContextCurrent();
- if (previousActiveContext)
- previousActiveContext->makeContextCurrent();
- }
-
+ auto attrs = m_context.contextAttributes();
TextureMapperGL& texmapGL = static_cast<TextureMapperGL&>(textureMapper);
TextureMapperGL::Flags flags = TextureMapperGL::ShouldFlipTexture | (attrs.alpha ? TextureMapperGL::ShouldBlend : 0);
IntSize textureSize(m_context.m_currentWidth, m_context.m_currentHeight);
- texmapGL.drawTexture(m_context.m_texture, flags, textureSize, targetRect, matrix, opacity);
-#endif // USE(TEXTURE_MAPPER_GL)
+ texmapGL.drawTexture(m_context.m_compositorTexture, flags, textureSize, targetRect, matrix, opacity);
+
+ m_context.markLayerComposited();
}
} // namespace WebCore