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 @@ ...@@ -7,19 +7,16 @@
"drawsContent": true, "drawsContent": true,
"children": [ "children": [
{ {
"children": [ "position": [205, 205],
{ "transformOrigin": [175, 175],
"position": [205, 205], "bounds": [225, 225],
"transformOrigin": [175, 175], "drawsContent": true,
"bounds": [225, 225], "backgroundColor": "#000000"
"drawsContent": true, },
"backgroundColor": "#000000" {
}, "bounds": [225, 225],
{ "drawsContent": true,
"bounds": [225, 225], "backgroundColor": "#008000"
"drawsContent": true
}
]
} }
] ]
} }
......
...@@ -7,19 +7,16 @@ ...@@ -7,19 +7,16 @@
"drawsContent": true, "drawsContent": true,
"children": [ "children": [
{ {
"children": [ "position": [105, 105],
{ "bounds": [100, 100],
"position": [105, 105], "contentsOpaque": true,
"bounds": [100, 100], "drawsContent": true,
"contentsOpaque": true, "backgroundColor": "#000000"
"drawsContent": true, },
"backgroundColor": "#000000" {
}, "bounds": [125, 125],
{ "drawsContent": true,
"bounds": [125, 125], "backgroundColor": "#008000"
"drawsContent": true
}
]
} }
] ]
} }
......
...@@ -7,19 +7,16 @@ ...@@ -7,19 +7,16 @@
"drawsContent": true, "drawsContent": true,
"children": [ "children": [
{ {
"children": [ "position": [105, 105],
{ "transformOrigin": [75, 75],
"position": [105, 105], "bounds": [125, 125],
"transformOrigin": [75, 75], "drawsContent": true,
"bounds": [125, 125], "backgroundColor": "#000000"
"drawsContent": true, },
"backgroundColor": "#000000" {
}, "bounds": [125, 125],
{ "drawsContent": true,
"bounds": [125, 125], "backgroundColor": "#008000"
"drawsContent": true
}
]
} }
] ]
} }
......
{
"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 @@ ...@@ -26,20 +26,17 @@
"drawsContent": true, "drawsContent": true,
"children": [ "children": [
{ {
"children": [ "position": [250, 250],
{ "bounds": [100, 100],
"position": [250, 250], "contentsOpaque": true,
"bounds": [100, 100], "drawsContent": true,
"contentsOpaque": true, "backgroundColor": "#0000FF"
"drawsContent": true, },
"backgroundColor": "#0000FF" {
}, "position": [100, 100],
{ "bounds": [200, 200],
"position": [100, 100], "drawsContent": true,
"bounds": [200, 200], "backgroundColor": "#000000"
"drawsContent": true
}
]
} }
] ]
} }
......
...@@ -26,20 +26,17 @@ ...@@ -26,20 +26,17 @@
"drawsContent": true, "drawsContent": true,
"children": [ "children": [
{ {
"children": [ "position": [250, 250],
{ "bounds": [100, 100],
"position": [250, 250], "contentsOpaque": true,
"bounds": [100, 100], "drawsContent": true,
"contentsOpaque": true, "backgroundColor": "#0000FF"
"drawsContent": true, },
"backgroundColor": "#0000FF" {
}, "position": [100, 100],
{ "bounds": [200, 200],
"position": [100, 100], "drawsContent": true,
"bounds": [200, 200], "backgroundColor": "#000000"
"drawsContent": true
}
]
} }
] ]
} }
......
...@@ -165,8 +165,8 @@ CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const ...@@ -165,8 +165,8 @@ CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
if (compositingInputs.transformAncestor != squashingLayerCompositingInputs.transformAncestor) if (compositingInputs.transformAncestor != squashingLayerCompositingInputs.transformAncestor)
return CompositingReasonSquashingTransformAncestorMismatch; return CompositingReasonSquashingTransformAncestorMismatch;
if (compositingInputs.filterAncestor != squashingLayerCompositingInputs.filterAncestor) if (layer->hasFilter() || compositingInputs.filterAncestor != squashingLayerCompositingInputs.filterAncestor)
return CompositingReasonSquashingFilterAncestorMismatch; return CompositingReasonSquashingFilterMismatch;
return CompositingReasonNone; return CompositingReasonNone;
} }
......
...@@ -79,9 +79,9 @@ const CompositingReasonStringMap kCompositingReasonStringMap[] = { ...@@ -79,9 +79,9 @@ const CompositingReasonStringMap kCompositingReasonStringMap[] = {
{ CompositingReasonSquashingTransformAncestorMismatch, { CompositingReasonSquashingTransformAncestorMismatch,
"squashingTransformAncestorMismatch", "squashingTransformAncestorMismatch",
"Cannot be squashed because this layer has a different transform ancestor than the squashing layer" }, "Cannot be squashed because this layer has a different transform ancestor than the squashing layer" },
{ CompositingReasonSquashingFilterAncestorMismatch, { CompositingReasonSquashingFilterMismatch,
"squashingFilterAncestorMismatch", "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, { CompositingReasonSquashingWouldBreakPaintOrder,
"squashingWouldBreakPaintOrder", "squashingWouldBreakPaintOrder",
"Cannot be squashed without breaking paint order" }, "Cannot be squashed without breaking paint order" },
......
...@@ -39,7 +39,7 @@ const uint64_t CompositingReasonSquashingSparsityExceeded = UINT6 ...@@ -39,7 +39,7 @@ const uint64_t CompositingReasonSquashingSparsityExceeded = UINT6
const uint64_t CompositingReasonSquashingClippingContainerMismatch = UINT64_C(1) << 19; const uint64_t CompositingReasonSquashingClippingContainerMismatch = UINT64_C(1) << 19;
const uint64_t CompositingReasonSquashingOpacityAncestorMismatch = UINT64_C(1) << 20; const uint64_t CompositingReasonSquashingOpacityAncestorMismatch = UINT64_C(1) << 20;
const uint64_t CompositingReasonSquashingTransformAncestorMismatch = UINT64_C(1) << 21; 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 CompositingReasonSquashingWouldBreakPaintOrder = UINT64_C(1) << 23;
const uint64_t CompositingReasonSquashingVideoIsDisallowed = UINT64_C(1) << 24; const uint64_t CompositingReasonSquashingVideoIsDisallowed = UINT64_C(1) << 24;
const uint64_t CompositingReasonSquashedLayerClipsCompositingDescendants = UINT64_C(1) << 25; const uint64_t CompositingReasonSquashedLayerClipsCompositingDescendants = UINT64_C(1) << 25;
...@@ -139,7 +139,7 @@ const uint64_t CompositingReasonComboReasonsThatRequireOwnBacking = ...@@ -139,7 +139,7 @@ const uint64_t CompositingReasonComboReasonsThatRequireOwnBacking =
| CompositingReasonSquashingClippingContainerMismatch | CompositingReasonSquashingClippingContainerMismatch
| CompositingReasonSquashingOpacityAncestorMismatch | CompositingReasonSquashingOpacityAncestorMismatch
| CompositingReasonSquashingTransformAncestorMismatch | CompositingReasonSquashingTransformAncestorMismatch
| CompositingReasonSquashingFilterAncestorMismatch | CompositingReasonSquashingFilterMismatch
| CompositingReasonSquashingWouldBreakPaintOrder | CompositingReasonSquashingWouldBreakPaintOrder
| CompositingReasonSquashingVideoIsDisallowed | CompositingReasonSquashingVideoIsDisallowed
| CompositingReasonSquashedLayerClipsCompositingDescendants | 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