Title: [253692] trunk/Source/WebCore
Revision
253692
Author
[email protected]
Date
2019-12-18 09:58:40 -0800 (Wed, 18 Dec 2019)

Log Message

Ensure transparency layers are properly ended when only painting root background
https://bugs.webkit.org/show_bug.cgi?id=205285

Patch by Doug Kelly <[email protected]> on 2019-12-18
Reviewed by Simon Fraser.

Ensure that if we are in a transparency layer and returning early from paintLayerContents() because of PaintLayerPaintingRootBackgroundOnly, we properly
reset the transparency state before returning.

* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContextStateStackChecker::~GraphicsContextStateStackChecker):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (253691 => 253692)


--- trunk/Source/WebCore/ChangeLog	2019-12-18 17:38:18 UTC (rev 253691)
+++ trunk/Source/WebCore/ChangeLog	2019-12-18 17:58:40 UTC (rev 253692)
@@ -1,3 +1,18 @@
+2019-12-18  Doug Kelly  <[email protected]>
+
+        Ensure transparency layers are properly ended when only painting root background
+        https://bugs.webkit.org/show_bug.cgi?id=205285
+
+        Reviewed by Simon Fraser.
+
+        Ensure that if we are in a transparency layer and returning early from paintLayerContents() because of PaintLayerPaintingRootBackgroundOnly, we properly
+        reset the transparency state before returning.
+
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::GraphicsContextStateStackChecker::~GraphicsContextStateStackChecker):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayerContents):
+
 2019-12-18  ChangSeok Oh  <[email protected]>
 
         [GTK] WebGL backed by ANGLE flickers when USE_OPENGL_ES is enabled.

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (253691 => 253692)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2019-12-18 17:38:18 UTC (rev 253691)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2019-12-18 17:58:40 UTC (rev 253692)
@@ -709,7 +709,7 @@
     ~GraphicsContextStateStackChecker()
     {
         if (m_context.stackSize() != m_stackSize)
-            WTFLogAlways("GraphicsContext %p stack changed by %d", this, (int)m_context.stackSize() - (int)m_stackSize);
+            WTFLogAlways("GraphicsContext %p stack changed by %d", &m_context, (int)m_context.stackSize() - (int)m_stackSize);
     }
 
 private:

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (253691 => 253692)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-12-18 17:38:18 UTC (rev 253691)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-12-18 17:58:40 UTC (rev 253692)
@@ -4532,8 +4532,16 @@
         || (!isPaintingScrollingContent && isPaintingCompositedForeground));
     bool shouldPaintContent = m_hasVisibleContent && isSelfPaintingLayer && !isPaintingOverlayScrollbars && !isCollectingEventRegion;
 
-    if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isDocumentElementRenderer())
+    if (localPaintFlags & PaintLayerPaintingRootBackgroundOnly && !renderer().isRenderView() && !renderer().isDocumentElementRenderer()) {
+        // If beginTransparencyLayers was called prior to this, ensure the transparency state is cleaned up before returning.
+        if (haveTransparency && m_usedTransparency && !m_paintingInsideReflection) {
+            context.endTransparencyLayer();
+            context.restore();
+            m_usedTransparency = false;
+        }
+
         return;
+    }
 
     updateLayerListsIfNeeded();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to