From a84c6dda2ab79017b9fbaa5cfd6ca554654913ac Mon Sep 17 00:00:00 2001 From: Huang Dongsung Date: Tue, 14 Jan 2014 14:20:13 +0100 Subject: [PATCH 15/20] [WebGL][EFL][Qt][GTK] Jelly fishes leave trails on webgl canvas. https://bugs.webkit.org/show_bug.cgi?id=105326 Reviewed by Noam Rosenthal. Clear a drawing buffer after compositing if preserveDrawingBuffer is false. http://www.khronos.org/registry/webgl/specs/latest/#2.2 No new tests. Covered by existing webgl-preserve-drawing-buffer-repaint test. * platform/graphics/cairo/GraphicsContext3DPrivate.cpp: (WebCore::GraphicsContext3DPrivate::paintToTextureMapper): * platform/graphics/efl/GraphicsContext3DPrivate.cpp: (GraphicsContext3DPrivate::copyToGraphicsSurface): * platform/graphics/qt/GraphicsContext3DQt.cpp: (WebCore::GraphicsContext3DPrivate::paintToTextureMapper): (WebCore::GraphicsContext3DPrivate::copyToGraphicsSurface): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138346 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 21 +++++++++++++++++++++ .../graphics/cairo/GraphicsContext3DPrivate.cpp | 2 ++ .../graphics/efl/GraphicsContext3DPrivate.cpp | 2 ++ .../platform/graphics/qt/GraphicsContext3DQt.cpp | 2 ++ 4 files changed, 27 insertions(+) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index f0ebd4c..3fb41fe 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1222,6 +1222,27 @@ 2012-12-20 Huang Dongsung + [WebGL][EFL][Qt][GTK] Jelly fishes leave trails on webgl canvas. + https://bugs.webkit.org/show_bug.cgi?id=105326 + + Reviewed by Noam Rosenthal. + + Clear a drawing buffer after compositing if preserveDrawingBuffer is + false. + http://www.khronos.org/registry/webgl/specs/latest/#2.2 + + No new tests. Covered by existing webgl-preserve-drawing-buffer-repaint test. + + * platform/graphics/cairo/GraphicsContext3DPrivate.cpp: + (WebCore::GraphicsContext3DPrivate::paintToTextureMapper): + * platform/graphics/efl/GraphicsContext3DPrivate.cpp: + (GraphicsContext3DPrivate::copyToGraphicsSurface): + * platform/graphics/qt/GraphicsContext3DQt.cpp: + (WebCore::GraphicsContext3DPrivate::paintToTextureMapper): + (WebCore::GraphicsContext3DPrivate::copyToGraphicsSurface): + +2012-12-20 Huang Dongsung + [TexMap] Remove ParentChange in TextureMapperLayer. https://bugs.webkit.org/show_bug.cgi?id=105494 diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp index 294169e..dc96e2d 100644 --- a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp +++ b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp @@ -85,6 +85,8 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper ASSERT(m_renderStyle == GraphicsContext3D::RenderOffscreen); + m_context->markLayerComposited(); + // FIXME: We do not support mask for the moment with TextureMapperImageBuffer. if (textureMapper->accelerationMode() != TextureMapper::OpenGLMode) { GraphicsContext* context = textureMapper->graphicsContext(); diff --git a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp index c9fc4a0..7f6024b 100644 --- a/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp +++ b/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp @@ -141,6 +141,8 @@ uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface() if (!m_platformContext || !makeContextCurrent()) return 0; + m_context->markLayerComposited(); + if (m_pendingSurfaceResize) { m_pendingSurfaceResize = false; m_platformSurface->setGeometry(IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight)); diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp index e72701d..683b76c 100644 --- a/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp +++ b/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp @@ -233,6 +233,7 @@ static inline quint32 swapBgrToRgb(quint32 pixel) #if USE(ACCELERATED_COMPOSITING) void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity, BitmapTexture* mask) { + m_context->markLayerComposited(); blitMultisampleFramebufferAndRestoreContext(); if (textureMapper->accelerationMode() == TextureMapper::OpenGLMode) { @@ -299,6 +300,7 @@ uint32_t GraphicsContext3DPrivate::copyToGraphicsSurface() if (!m_graphicsSurface) return 0; + m_context->markLayerComposited(); blitMultisampleFramebufferAndRestoreContext(); makeCurrentIfNeeded(); m_graphicsSurface->copyFromTexture(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight)); -- 1.8.5.3