Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Overlap map for compositing should ignore empty layers
https://bugs.webkit.org/show_bug.cgi?id=63499

Reviewed by Simon Fraser.

Source/WebCore:

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

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

LayoutTests:

* compositing/layer-creation/overlap-empty-layer-expected.txt: Added.
* compositing/layer-creation/overlap-empty-layer.html: Added.


Canonical link: https://commits.webkit.org/97606@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@109981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
quisquous committed Mar 7, 2012
1 parent 8431d6f commit 1365e58
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 5 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2012-03-06 Adrienne Walker <enne@google.com>

Overlap map for compositing should ignore empty layers
https://bugs.webkit.org/show_bug.cgi?id=63499

Reviewed by Simon Fraser.

* compositing/layer-creation/overlap-empty-layer-expected.txt: Added.
* compositing/layer-creation/overlap-empty-layer.html: Added.

2012-03-06 Kent Tamura <tkent@chromium.org>

[Chromium] Rebaseline of input-appearance-numberandspeech.html for r109876.
Expand Down
@@ -0,0 +1,23 @@
(GraphicsLayer
(bounds 842.00 600.00)
(children 1
(GraphicsLayer
(bounds 842.00 600.00)
(children 1
(GraphicsLayer
(position 8.00 8.00)
(bounds 784.00 0.00)
(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] [50.00 50.00 0.00 1.00])
(children 1
(GraphicsLayer
(position 200.00 200.00)
(bounds 80.00 80.00)
(drawsContent 1)
)
)
)
)
)
)
)

51 changes: 51 additions & 0 deletions LayoutTests/compositing/layer-creation/overlap-empty-layer.html
@@ -0,0 +1,51 @@
<html>
<head>
<style>
body {
overflow: hidden;
}

#container {
-webkit-transform: translate(50px, 50px);
}

#composited {
-webkit-transform:translateZ(0);
position:absolute;
top: 200px;
left: 200px;
width: 80px;
height: 80px;
background-color: blue;
}

#overlap {
position: absolute;
top: 0px;
left: 0px;
width: 100px;
height: 100px;
background-color: blue;
}
</style>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText(false);
window.addEventListener('load', function() {
document.getElementById("layertree").innerText = layoutTestController.layerTreeAsText();
}, false);
}
</script>
</head>
<body>
<div id="container">
<div id="composited"></div>
</div>

<!-- This overlaps all of container, but not the composited child. -->
<!-- It should not get its own composited layer. -->
<div id="overlap"></div>

<pre id="layertree"></pre>
</body>
</html>
13 changes: 13 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
2012-03-06 Adrienne Walker <enne@google.com>

Overlap map for compositing should ignore empty layers
https://bugs.webkit.org/show_bug.cgi?id=63499

Reviewed by Simon Fraser.

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

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

2012-03-06 Vangelis Kokkevis <vangelis@chromium.org>

[chromium] Increase the accelerated canvas min size to 256 * 256
Expand Down
8 changes: 3 additions & 5 deletions Source/WebCore/rendering/RenderLayerCompositor.cpp
Expand Up @@ -638,12 +638,12 @@ void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, RenderLayer*

if (!boundsComputed) {
layerBounds = layer->renderer()->localToAbsoluteQuad(FloatRect(layer->localBoundingBox())).enclosingBoundingBox();
// Empty rects never intersect, but we need them to for the purposes of overlap testing.
if (layerBounds.isEmpty())
layerBounds.setSize(IntSize(1, 1));
boundsComputed = true;
}

if (layerBounds.isEmpty())
return;

IntRect clipRect = pixelSnappedIntRect(layer->backgroundClipRect(rootRenderLayer(), 0, true).rect()); // FIXME: Incorrect for CSS regions.
clipRect.scale(pageScaleFactor());
clipRect.intersect(layerBounds);
Expand Down Expand Up @@ -715,8 +715,6 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* layer, O
// If we're testing for overlap, we only need to composite if we overlap something that is already composited.
absBounds = layer->renderer()->localToAbsoluteQuad(FloatRect(layer->localBoundingBox())).enclosingBoundingBox();
// Empty rects never intersect, but we need them to for the purposes of overlap testing.
if (absBounds.isEmpty())
absBounds.setSize(IntSize(1, 1));
haveComputedBounds = true;
mustOverlapCompositedLayers = overlapMap->overlapsLayers(absBounds);
}
Expand Down

0 comments on commit 1365e58

Please sign in to comment.