Title: [88698] trunk
Revision
88698
Author
e...@google.com
Date
2011-06-13 14:33:13 -0700 (Mon, 13 Jun 2011)

Log Message

2011-06-13  Adrienne Walker  <e...@google.com>

        Reviewed by Simon Fraser.

        Overlap test needs to consider children of composited layers
        https://bugs.webkit.org/show_bug.cgi?id=62465

        * compositing/layer-creation/overlap-child-layer-expected.png: Added.
        * compositing/layer-creation/overlap-child-layer-expected.txt: Added.
        * compositing/layer-creation/overlap-child-layer.html: Added.
2011-06-13  Adrienne Walker  <e...@google.com>

        Reviewed by Simon Fraser.

        Overlap test needs to consider children of composited layers
        https://bugs.webkit.org/show_bug.cgi?id=62465

        Any child layer with a compositing ancestor will be put into a
        composited layer even though they themselves don't need compositing.
        As layer bounds aren't hierarchical, these layer bounds themselves
        need to be put into the overlap map because the composited layer
        itself is not sufficient.

        Test: compositing/layer-creation/overlap-animated-layer.html

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

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88697 => 88698)


--- trunk/LayoutTests/ChangeLog	2011-06-13 21:29:25 UTC (rev 88697)
+++ trunk/LayoutTests/ChangeLog	2011-06-13 21:33:13 UTC (rev 88698)
@@ -1,3 +1,14 @@
+2011-06-13  Adrienne Walker  <e...@google.com>
+
+        Reviewed by Simon Fraser.
+
+        Overlap test needs to consider children of composited layers
+        https://bugs.webkit.org/show_bug.cgi?id=62465
+
+        * compositing/layer-creation/overlap-child-layer-expected.png: Added.
+        * compositing/layer-creation/overlap-child-layer-expected.txt: Added.
+        * compositing/layer-creation/overlap-child-layer.html: Added.
+
 2011-06-13  Dimitri Glazkov  <dglaz...@chromium.org>
 
         [Chromium] Correctly classify the test as failing.

Added: trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt (0 => 88698)


--- trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt	2011-06-13 21:33:13 UTC (rev 88698)
@@ -0,0 +1,20 @@
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 2
+        (GraphicsLayer
+          (anchor 1.56 0.00)
+          (bounds 256.00 256.00)
+          (drawsContent 1)
+        )
+        (GraphicsLayer
+          (bounds 300.00 300.00)
+          (drawsContent 1)
+        )
+      )
+    )
+  )
+)
+
Property changes on: trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/layer-creation/overlap-child-layer.html (0 => 88698)


--- trunk/LayoutTests/compositing/layer-creation/overlap-child-layer.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/layer-creation/overlap-child-layer.html	2011-06-13 21:33:13 UTC (rev 88698)
@@ -0,0 +1,67 @@
+<html>
+<head>
+<style>
+    #container {
+        position: absolute;
+        top: 0px;
+        left: 400px;
+        -webkit-transform: translateZ(0);
+    }
+
+    #red {
+        position: absolute;
+        top: 0px;
+        left: -400px;
+        height: 256px;
+        width: 256px;
+        background-color: red;
+    }
+
+    #green {
+        position: absolute;
+        left: 0px;
+        top: 0px;
+        width: 300px;
+        height: 300px;
+        background-color: green;
+    }
+
+    #layertree {
+        position: absolute;
+        left: 10000px;
+        top: 0px;
+    }
+
+    body {
+        overflow: hidden;
+    }
+
+</style>
+
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText(true);
+        layoutTestController.waitUntilDone();
+    }
+
+    window.addEventListener('load', function() {
+        if (window.layoutTestController) {
+            document.getElementById("layertree").innerText = layoutTestController.layerTreeAsText();
+            layoutTestController.notifyDone();
+        }
+    }, false);
+</script>
+
+<body>
+    <!-- container has empty bounds, but is composited -->
+    <div id="container">
+        <!-- this red square should not appear over the green square -->
+        <div id="red"></div>
+    </div>
+
+    <!-- This green square should composite because it overlaps the red one -->
+    <div id="green"></div>
+
+    <pre id="layertree"></pre>
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/layer-creation/overlap-child-layer.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (88697 => 88698)


--- trunk/Source/WebCore/ChangeLog	2011-06-13 21:29:25 UTC (rev 88697)
+++ trunk/Source/WebCore/ChangeLog	2011-06-13 21:33:13 UTC (rev 88698)
@@ -1,3 +1,21 @@
+2011-06-13  Adrienne Walker  <e...@google.com>
+
+        Reviewed by Simon Fraser.
+
+        Overlap test needs to consider children of composited layers
+        https://bugs.webkit.org/show_bug.cgi?id=62465
+
+        Any child layer with a compositing ancestor will be put into a
+        composited layer even though they themselves don't need compositing.
+        As layer bounds aren't hierarchical, these layer bounds themselves
+        need to be put into the overlap map because the composited layer
+        itself is not sufficient.
+
+        Test: compositing/layer-creation/overlap-animated-layer.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
 2011-06-13  Xan Lopez  <xlo...@igalia.com>
 
         Unreviewed build fix.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (88697 => 88698)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2011-06-13 21:29:25 UTC (rev 88697)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2011-06-13 21:33:13 UTC (rev 88698)
@@ -629,10 +629,12 @@
         compositingState.m_subtreeIsCompositing = true;
         // This layer now acts as the ancestor for kids.
         childState.m_compositingAncestor = layer;
-        if (overlapMap)
-            addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds);
     }
 
+    if (overlapMap && childState.m_compositingAncestor && !childState.m_compositingAncestor->isRootLayer()) {
+        addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds);
+    }
+
 #if ENABLE(VIDEO)
     // Video is special. It's a replaced element with a content layer, but has shadow content
     // for the controller that must render in front. Without this, the controls fail to show
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to