Commit 81771200 authored by chrishtr@chromium.org's avatar chrishtr@chromium.org

Don't squash layers that have filters.

BUG=409727

Review URL: https://codereview.chromium.org/547493002

git-svn-id: svn://svn.chromium.org/blink/trunk@181496 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fafcb957
......@@ -7,19 +7,16 @@
"drawsContent": true,
"children": [
{
"children": [
{
"position": [205, 205],
"transformOrigin": [175, 175],
"bounds": [225, 225],
"drawsContent": true,
"backgroundColor": "#000000"
},
{
"bounds": [225, 225],
"drawsContent": true
}
]
"position": [205, 205],
"transformOrigin": [175, 175],
"bounds": [225, 225],
"drawsContent": true,
"backgroundColor": "#000000"
},
{
"bounds": [225, 225],
"drawsContent": true,
"backgroundColor": "#008000"
}
]
}
......
......@@ -7,19 +7,16 @@
"drawsContent": true,
"children": [
{
"children": [
{
"position": [105, 105],
"bounds": [100, 100],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#000000"
},
{
"bounds": [125, 125],
"drawsContent": true
}
]
"position": [105, 105],
"bounds": [100, 100],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#000000"
},
{
"bounds": [125, 125],
"drawsContent": true,
"backgroundColor": "#008000"
}
]
}
......
......@@ -7,19 +7,16 @@
"drawsContent": true,
"children": [
{
"children": [
{
"position": [105, 105],
"transformOrigin": [75, 75],
"bounds": [125, 125],
"drawsContent": true,
"backgroundColor": "#000000"
},
{
"bounds": [125, 125],
"drawsContent": true
}
]
"position": [105, 105],
"transformOrigin": [75, 75],
"bounds": [125, 125],
"drawsContent": true,
"backgroundColor": "#000000"
},
{
"bounds": [125, 125],
"drawsContent": true,
"backgroundColor": "#008000"
}
]
}
......
{
"bounds": [800, 600],
"children": [
{
"bounds": [800, 600],
"contentsOpaque": true,
"drawsContent": true,
"children": [
{
"position": [8, 8],
"bounds": [100, 100],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#ADD8E6"
},
{
"children": [
{
"position": [-5, -5],
"bounds": [62, 62],
"drawsContent": true,
"backgroundColor": "#D3D3D3"
},
{
"position": [50, 50],
"bounds": [50, 50],
"drawsContent": true
}
]
}
]
}
]
}
<!DOCTYPE html>
<style>
.trysquashed {
width: 50px; height: 50px; background: lightgray
}
</style>
<div style="width: 100px; height: 100px; transform: translateZ(0); background: lightblue"></div>
<div class="trysquashed" style="position: absolute; top: 0px; left: 0px; -webkit-filter: drop-shadow(1px 1px 2px #000)"></div>
<div class="trysquashed" style="position: absolute; top: 50px; left: 50px;"></div>
<pre id="layers"></pre>
<script>
// Tests that layers with filters are not squashed.
if (window.testRunner)
window.testRunner.dumpAsText();
var layersResult = document.getElementById('layers');
if (window.internals)
layersResult.innerText = window.internals.layerTreeAsText(document);
</script>
\ No newline at end of file
......@@ -26,20 +26,17 @@
"drawsContent": true,
"children": [
{
"children": [
{
"position": [250, 250],
"bounds": [100, 100],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#0000FF"
},
{
"position": [100, 100],
"bounds": [200, 200],
"drawsContent": true
}
]
"position": [250, 250],
"bounds": [100, 100],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#0000FF"
},
{
"position": [100, 100],
"bounds": [200, 200],
"drawsContent": true,
"backgroundColor": "#000000"
}
]
}
......
......@@ -26,20 +26,17 @@
"drawsContent": true,
"children": [
{
"children": [
{
"position": [250, 250],
"bounds": [100, 100],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#0000FF"
},
{
"position": [100, 100],
"bounds": [200, 200],
"drawsContent": true
}
]
"position": [250, 250],
"bounds": [100, 100],
"contentsOpaque": true,
"drawsContent": true,
"backgroundColor": "#0000FF"
},
{
"position": [100, 100],
"bounds": [200, 200],
"drawsContent": true,
"backgroundColor": "#000000"
}
]
}
......
......@@ -165,8 +165,8 @@ CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
if (compositingInputs.transformAncestor != squashingLayerCompositingInputs.transformAncestor)
return CompositingReasonSquashingTransformAncestorMismatch;
if (compositingInputs.filterAncestor != squashingLayerCompositingInputs.filterAncestor)
return CompositingReasonSquashingFilterAncestorMismatch;
if (layer->hasFilter() || compositingInputs.filterAncestor != squashingLayerCompositingInputs.filterAncestor)
return CompositingReasonSquashingFilterMismatch;
return CompositingReasonNone;
}
......
......@@ -79,9 +79,9 @@ const CompositingReasonStringMap kCompositingReasonStringMap[] = {
{ CompositingReasonSquashingTransformAncestorMismatch,
"squashingTransformAncestorMismatch",
"Cannot be squashed because this layer has a different transform ancestor than the squashing layer" },
{ CompositingReasonSquashingFilterAncestorMismatch,
{ CompositingReasonSquashingFilterMismatch,
"squashingFilterAncestorMismatch",
"Cannot be squashed because this layer has a different filter ancestor than the squashing layer" },
"Cannot be squashed because this layer has a different filter ancestor than the squashing layer, or this layer has a filter" },
{ CompositingReasonSquashingWouldBreakPaintOrder,
"squashingWouldBreakPaintOrder",
"Cannot be squashed without breaking paint order" },
......
......@@ -39,7 +39,7 @@ const uint64_t CompositingReasonSquashingSparsityExceeded = UINT6
const uint64_t CompositingReasonSquashingClippingContainerMismatch = UINT64_C(1) << 19;
const uint64_t CompositingReasonSquashingOpacityAncestorMismatch = UINT64_C(1) << 20;
const uint64_t CompositingReasonSquashingTransformAncestorMismatch = UINT64_C(1) << 21;
const uint64_t CompositingReasonSquashingFilterAncestorMismatch = UINT64_C(1) << 22;
const uint64_t CompositingReasonSquashingFilterMismatch = UINT64_C(1) << 22;
const uint64_t CompositingReasonSquashingWouldBreakPaintOrder = UINT64_C(1) << 23;
const uint64_t CompositingReasonSquashingVideoIsDisallowed = UINT64_C(1) << 24;
const uint64_t CompositingReasonSquashedLayerClipsCompositingDescendants = UINT64_C(1) << 25;
......@@ -139,7 +139,7 @@ const uint64_t CompositingReasonComboReasonsThatRequireOwnBacking =
| CompositingReasonSquashingClippingContainerMismatch
| CompositingReasonSquashingOpacityAncestorMismatch
| CompositingReasonSquashingTransformAncestorMismatch
| CompositingReasonSquashingFilterAncestorMismatch
| CompositingReasonSquashingFilterMismatch
| CompositingReasonSquashingWouldBreakPaintOrder
| CompositingReasonSquashingVideoIsDisallowed
| CompositingReasonSquashedLayerClipsCompositingDescendants
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment