Title: [90037] branches/chromium/782
- Revision
- 90037
- Author
- [email protected]
- Date
- 2011-06-29 13:14:12 -0700 (Wed, 29 Jun 2011)
Log Message
Merge 88698 - 2011-06-13 Adrienne Walker <[email protected]>
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 <[email protected]>
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):
[email protected]
Modified Paths
Added Paths
Diff
Copied: branches/chromium/782/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.png (from rev 88698, trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.png)
(Binary files differ)
Copied: branches/chromium/782/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt (from rev 88698, trunk/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt) (0 => 90037)
--- branches/chromium/782/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt (rev 0)
+++ branches/chromium/782/LayoutTests/compositing/layer-creation/overlap-child-layer-expected.txt 2011-06-29 20:14:12 UTC (rev 90037)
@@ -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)
+ )
+ )
+ )
+ )
+)
+
Copied: branches/chromium/782/LayoutTests/compositing/layer-creation/overlap-child-layer.html (from rev 88698, trunk/LayoutTests/compositing/layer-creation/overlap-child-layer.html) (0 => 90037)
--- branches/chromium/782/LayoutTests/compositing/layer-creation/overlap-child-layer.html (rev 0)
+++ branches/chromium/782/LayoutTests/compositing/layer-creation/overlap-child-layer.html 2011-06-29 20:14:12 UTC (rev 90037)
@@ -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>
Modified: branches/chromium/782/Source/WebCore/rendering/RenderLayerCompositor.cpp (90036 => 90037)
--- branches/chromium/782/Source/WebCore/rendering/RenderLayerCompositor.cpp 2011-06-29 19:47:04 UTC (rev 90036)
+++ branches/chromium/782/Source/WebCore/rendering/RenderLayerCompositor.cpp 2011-06-29 20:14:12 UTC (rev 90037)
@@ -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
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes