Title: [105090] trunk
Revision
105090
Author
[email protected]
Date
2012-01-16 14:19:36 -0800 (Mon, 16 Jan 2012)

Log Message

Filtered element with composited content beneath it must be composited
https://bugs.webkit.org/show_bug.cgi?id=76322

Source/WebCore:

Reviewed by Dean Jackson.

If a RenderLayer has a filter effect, and a composited descendant, then
that layer must also be composited so that the filter is applied via
the compositing system, rather than via painting (otherwise the filter
will not affect the descendant).

Test: css3/filters/filtered-compositing-descendant.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingWhenDescendantsAreCompositing):

LayoutTests:

Reviewed by Dean Jackson.

Testcase with a filtered element having a composited child.

* css3/filters/filtered-compositing-descendant-expected.png: Added.
* css3/filters/filtered-compositing-descendant-expected.txt: Added.
* css3/filters/filtered-compositing-descendant.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105089 => 105090)


--- trunk/LayoutTests/ChangeLog	2012-01-16 21:53:39 UTC (rev 105089)
+++ trunk/LayoutTests/ChangeLog	2012-01-16 22:19:36 UTC (rev 105090)
@@ -1,3 +1,16 @@
+2012-01-16  Simon Fraser  <[email protected]>
+
+        Filtered element with composited content beneath it must be composited
+        https://bugs.webkit.org/show_bug.cgi?id=76322
+
+        Reviewed by Dean Jackson.
+        
+        Testcase with a filtered element having a composited child.
+
+        * css3/filters/filtered-compositing-descendant-expected.png: Added.
+        * css3/filters/filtered-compositing-descendant-expected.txt: Added.
+        * css3/filters/filtered-compositing-descendant.html: Added.
+
 2012-01-16  xueqing huang  <[email protected]>
 
         Add offline web applications API applicationCache.abort.

Added: trunk/LayoutTests/css3/filters/filtered-compositing-descendant-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/css3/filters/filtered-compositing-descendant-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/css3/filters/filtered-compositing-descendant-expected.txt (0 => 105090)


--- trunk/LayoutTests/css3/filters/filtered-compositing-descendant-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/filtered-compositing-descendant-expected.txt	2012-01-16 22:19:36 UTC (rev 105090)
@@ -0,0 +1,30 @@
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 2
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 144.00 144.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 22.00 22.00)
+              (bounds 100.00 100.00)
+              (drawsContent 1)
+              (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+            )
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 165.00)
+          (bounds 784.00 15.00)
+          (opacity 0.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
Property changes on: trunk/LayoutTests/css3/filters/filtered-compositing-descendant-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/css3/filters/filtered-compositing-descendant.html (0 => 105090)


--- trunk/LayoutTests/css3/filters/filtered-compositing-descendant.html	                        (rev 0)
+++ trunk/LayoutTests/css3/filters/filtered-compositing-descendant.html	2012-01-16 22:19:36 UTC (rev 105090)
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    body {
+      overflow: hidden;
+    }
+    .box {
+      width: 100px;
+      height: 100px;
+    }
+    .filtered {
+      -webkit-filter: saturate(0);
+      padding: 20px;
+      border: 2px solid black;
+    }
+    .compositing {
+      -webkit-transform: translateZ(1px);
+      background-color: red;
+    }
+    
+    pre {
+      opacity: 0; /* hide in pixel result */
+    }
+  </style>
+  <script>
+    if (window.layoutTestController)
+      layoutTestController.dumpAsText(true);
+
+    window.addEventListener('load', function () {
+      if (window.layoutTestController)
+        document.getElementById('layer-tree').innerText = layoutTestController.layerTreeAsText();
+    }, false);
+  </script>
+</head>
+<body>
+  <!-- You should see no red below -->
+  <div class="filtered box">
+    <div class="compositing box"></div>
+  </div>
+<pre id="layer-tree">Layer tree goes here in DRT</pre>
+</body>
+</html>
Property changes on: trunk/LayoutTests/css3/filters/filtered-compositing-descendant.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (105089 => 105090)


--- trunk/Source/WebCore/ChangeLog	2012-01-16 21:53:39 UTC (rev 105089)
+++ trunk/Source/WebCore/ChangeLog	2012-01-16 22:19:36 UTC (rev 105090)
@@ -1,3 +1,20 @@
+2012-01-16  Simon Fraser  <[email protected]>
+
+        Filtered element with composited content beneath it must be composited
+        https://bugs.webkit.org/show_bug.cgi?id=76322
+
+        Reviewed by Dean Jackson.
+        
+        If a RenderLayer has a filter effect, and a composited descendant, then
+        that layer must also be composited so that the filter is applied via
+        the compositing system, rather than via painting (otherwise the filter
+        will not affect the descendant).
+
+        Test: css3/filters/filtered-compositing-descendant.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingWhenDescendantsAreCompositing):
+
 2012-01-16  Andreas Kling  <[email protected]>
 
         Fix assertion failure in mappedAttributesEquivalent().

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (105089 => 105090)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-16 21:53:39 UTC (rev 105089)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-16 22:19:36 UTC (rev 105090)
@@ -1505,7 +1505,7 @@
 
 bool RenderLayerCompositor::requiresCompositingWhenDescendantsAreCompositing(RenderObject* renderer) const
 {
-    return renderer->hasTransform() || renderer->isTransparent() || renderer->hasMask() || renderer->hasReflection();
+    return renderer->hasTransform() || renderer->isTransparent() || renderer->hasMask() || renderer->hasReflection() || renderer->hasFilter();
 }
     
 bool RenderLayerCompositor::requiresCompositingForFullScreen(RenderObject* renderer) const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to