haikuwebkit/LayoutTests/compositing/filters/sw-layer-overlaps-hw-shadow...

45 lines
1.2 KiB
HTML
Raw Permalink Normal View History

[CSS Filters] RenderLayerCompositor::addToOverlapMap should take into account the filters outsets (ie. blur and drop-shadow) https://bugs.webkit.org/show_bug.cgi?id=94022 Reviewed by Simon Fraser. Source/WebCore: When a layer has a filter that moves pixels, we need to add its entire bounds, including its outsets and children, to the overlap map. The filter can move the children's pixels anywhere in the layer, so we can't rely on the children's bounds. Eventually, we should avoid adding children to the overlap map if the parent's bounds used for overlap testing already include the children. I've added a FIXME for this optimization. Tests: compositing/filters/sw-layer-overlaps-hw-shadow.html compositing/filters/sw-nested-shadow-overlaps-hw-nested-shadow.html compositing/filters/sw-shadow-overlaps-hw-layer.html compositing/filters/sw-shadow-overlaps-hw-shadow.html * rendering/RenderLayer.h: (WebCore::RenderLayer::overlapBounds): If necessary, return the calculated layer bounds, including the children. Otherwise, return the localBoundingBox. (RenderLayer): (WebCore::RenderLayer::overlapBoundsIncludeChildren): If the layer has a filter that moves pixels, return true. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::addToOverlapMap): Add the overlapBounds instead of the localBoundingBox to the overlap map. (WebCore::RenderLayerCompositor::computeCompositingRequirements): Use the overlapBounds instead of the localBoundingBox for overlap testing. LayoutTests: Add tests to check several combinations of software layer and composited layer overlap when filter outsets are involved. * compositing/filters/sw-layer-overlaps-hw-shadow-expected.txt: Added. * compositing/filters/sw-layer-overlaps-hw-shadow.html: Added. * compositing/filters/sw-nested-shadow-overlaps-hw-nested-shadow-expected.txt: Added. * compositing/filters/sw-nested-shadow-overlaps-hw-nested-shadow.html: Added. * compositing/filters/sw-shadow-overlaps-hw-layer-expected.txt: Added. * compositing/filters/sw-shadow-overlaps-hw-layer.html: Added. * compositing/filters/sw-shadow-overlaps-hw-shadow-expected.txt: Added. * compositing/filters/sw-shadow-overlaps-hw-shadow.html: Added. * platform/chromium/compositing/filters/sw-layer-overlaps-hw-shadow-expected.txt: Added. * platform/chromium/compositing/filters/sw-shadow-overlaps-hw-layer-expected.txt: Added. Canonical link: https://commits.webkit.org/124775@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-01-10 18:16:00 +00:00
<!doctype html>
<html>
<head>
<title>
This test verifies that a software layer will be promoted to a composited layer
if it intersects a composited layer's drop shadow.
</title>
<!-- If the test passes, the light green drop shadow should appear over the the black div where they intersect. -->
<style>
#software {
background-color: green;
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
}
#composited {
background-color: black;
-webkit-filter: drop-shadow(-25px -25px 0 gray);
position: absolute;
top: 105px;
left: 105px;
width: 100px;
height: 100px;
-webkit-transform: translate3d(0, 0, 0);
}
</style>
</head>
<body>
<div id="composited"></div>
<div id="software"></div>
<pre id="console"></pre>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
document.getElementById("console").appendChild(document.createTextNode(window.internals.layerTreeAsText(document)));
}
</script>
</body>
</html>