Title: [166526] trunk
Revision
166526
Author
[email protected]
Date
2014-03-31 14:07:39 -0700 (Mon, 31 Mar 2014)

Log Message

[CSS Blending] Blend mode property is propagated to multiple GraphicLayers
https://bugs.webkit.org/show_bug.cgi?id=130337

Patch by Ion Rosca <[email protected]> on 2014-03-31
Reviewed by Dean Jackson.

Source/WebCore:

Resets the blend mode for graphicsLayer when it has an ancestorClippingLayer.

Test: css3/compositing/blend-mode-ancestor-clipping-layer.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateBlendMode):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBlendMode):
* rendering/RenderLayerBacking.h:

LayoutTests:

* css3/compositing/blend-mode-ancestor-clipping-layer-expected.txt: Added.
* css3/compositing/blend-mode-ancestor-clipping-layer.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (166525 => 166526)


--- trunk/LayoutTests/ChangeLog	2014-03-31 21:06:48 UTC (rev 166525)
+++ trunk/LayoutTests/ChangeLog	2014-03-31 21:07:39 UTC (rev 166526)
@@ -1,5 +1,15 @@
 2014-03-31  Ion Rosca  <[email protected]>
 
+        [CSS Blending] Blend mode property is propagated to multiple GraphicLayers
+        https://bugs.webkit.org/show_bug.cgi?id=130337
+
+        Reviewed by Dean Jackson.
+
+        * css3/compositing/blend-mode-ancestor-clipping-layer-expected.txt: Added.
+        * css3/compositing/blend-mode-ancestor-clipping-layer.html: Added.
+
+2014-03-31  Ion Rosca  <[email protected]>
+
         [CSS Blending] showLayerTree should dump layer's blend mode and isolation properties
         https://bugs.webkit.org/show_bug.cgi?id=130922
 

Added: trunk/LayoutTests/css3/compositing/blend-mode-ancestor-clipping-layer-expected.txt (0 => 166526)


--- trunk/LayoutTests/css3/compositing/blend-mode-ancestor-clipping-layer-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-ancestor-clipping-layer-expected.txt	2014-03-31 21:07:39 UTC (rev 166526)
@@ -0,0 +1,29 @@
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (bounds 800.00 600.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 8.00 8.00)
+              (bounds 100.00 100.00)
+              (blendMode difference)
+              (children 1
+                (GraphicsLayer
+                  (bounds 200.00 200.00)
+                  (contentsOpaque 1)
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/css3/compositing/blend-mode-ancestor-clipping-layer.html (0 => 166526)


--- trunk/LayoutTests/css3/compositing/blend-mode-ancestor-clipping-layer.html	                        (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-ancestor-clipping-layer.html	2014-03-31 21:07:39 UTC (rev 166526)
@@ -0,0 +1,32 @@
+ <!DOCTYPE HTML>
+<!-- Test if the blend mode property is propagated to the ancestorClippingLayer. -->
+
+ <style>
+ 	.parent {
+ 		width: 100px;
+ 		height: 100px;
+ 		background: yellow;
+ 		overflow: hidden;
+ 	}
+
+ 	.child {
+ 		width: 200px;
+ 		height: 200px;
+ 		background: red;
+ 		-webkit-transform:translateZ(0px);
+ 		-webkit-mix-blend-mode: difference;
+ 	}
+ </style>
+
+ <div class="parent">
+     <div class="child"></div>
+ </div>
+ <pre id="layerTree"></pre>
+ 
+ <script>
+    if (window.testRunner)
+        window.testRunner.dumpAsText();
+
+    var text = document.getElementById("layerTree");
+    text.innerHTML = window.internals.layerTreeAsText(document);
+</script>

Modified: trunk/Source/WebCore/ChangeLog (166525 => 166526)


--- trunk/Source/WebCore/ChangeLog	2014-03-31 21:06:48 UTC (rev 166525)
+++ trunk/Source/WebCore/ChangeLog	2014-03-31 21:07:39 UTC (rev 166526)
@@ -1,5 +1,23 @@
 2014-03-31  Ion Rosca  <[email protected]>
 
+        [CSS Blending] Blend mode property is propagated to multiple GraphicLayers
+        https://bugs.webkit.org/show_bug.cgi?id=130337
+
+        Reviewed by Dean Jackson.
+
+        Resets the blend mode for graphicsLayer when it has an ancestorClippingLayer.
+
+        Test: css3/compositing/blend-mode-ancestor-clipping-layer.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateBlendMode):
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateBlendMode):
+        * rendering/RenderLayerBacking.h:
+
+2014-03-31  Ion Rosca  <[email protected]>
+
         [CSS Blending] showLayerTree should dump layer's blend mode and isolation properties
         https://bugs.webkit.org/show_bug.cgi?id=130922
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (166525 => 166526)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2014-03-31 21:06:48 UTC (rev 166525)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2014-03-31 21:07:39 UTC (rev 166526)
@@ -815,11 +815,8 @@
     }
 
     BlendMode newBlendMode = renderer().style().blendMode();
-    if (newBlendMode != m_blendMode) {
+    if (newBlendMode != m_blendMode)
         m_blendMode = newBlendMode;
-        if (backing())
-            backing()->setBlendMode(newBlendMode);
-    }
 }
 
 void RenderLayer::updateNonCompositedParentStackingContextHasBlendedChild(bool hasBlendedChild)
@@ -5930,9 +5927,6 @@
 #if ENABLE(CSS_FILTERS)
         updateOrRemoveFilterEffectRenderer();
 #endif
-#if ENABLE(CSS_COMPOSITING)
-        backing()->setBlendMode(m_blendMode);
-#endif
     }
     return m_backing.get();
 }

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (166525 => 166526)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2014-03-31 21:06:48 UTC (rev 166525)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2014-03-31 21:07:39 UTC (rev 166526)
@@ -394,9 +394,10 @@
 #if ENABLE(CSS_COMPOSITING)
 void RenderLayerBacking::updateBlendMode(const RenderStyle* style)
 {
-    if (m_ancestorClippingLayer)
+    if (m_ancestorClippingLayer) {
         m_ancestorClippingLayer->setBlendMode(style->blendMode());
-    else
+        m_graphicsLayer->setBlendMode(BlendModeNormal);
+    } else
         m_graphicsLayer->setBlendMode(style->blendMode());
 }
 #endif
@@ -2047,13 +2048,6 @@
     compositor().repaintInCompositedAncestor(m_owningLayer, compositedBounds());
 }
 
-#if ENABLE(CSS_COMPOSITING)
-void RenderLayerBacking::setBlendMode(BlendMode blendMode)
-{
-    m_graphicsLayer->setBlendMode(blendMode);
-}
-#endif
-
 void RenderLayerBacking::setContentsNeedDisplay(GraphicsLayer::ShouldClipToLayer shouldClip)
 {
     ASSERT(!paintsIntoCompositedAncestor());

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (166525 => 166526)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.h	2014-03-31 21:06:48 UTC (rev 166525)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h	2014-03-31 21:07:39 UTC (rev 166526)
@@ -214,10 +214,6 @@
     // Return an estimate of the backing store area (in pixels) allocated by this object's GraphicsLayers.
     double backingStoreMemoryEstimate() const;
 
-#if ENABLE(CSS_COMPOSITING)
-    void setBlendMode(BlendMode);
-#endif
-
     LayoutSize devicePixelFractionFromRenderer() const { return m_devicePixelFractionFromRenderer; }
 
 private:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to