Skip to content

Commit

Permalink
Fix interest rect computation for squashed layers under transform.
Browse files Browse the repository at this point in the history
Instead of using one of the squashed layers as the starting point, use
the transformed ancestor, from which we have already computed an offset
to the squashing layer.

As a result, remove the squashing-prevention rule about non-translation
transforms.

Bug: 750433
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I4cf1fc5a2e34d7e40023d4c3481bb517c3b6e72f
Reviewed-on: https://chromium-review.googlesource.com/658335
Reviewed-by: Tien-Ren Chen <trchen@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501157}
  • Loading branch information
chrishtr authored and Commit Bot committed Sep 12, 2017
1 parent 75074c5 commit 707023d
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,34 +105,22 @@ After:
"contentsOpaque": true,
"backgroundColor": "#FFFFFF"
},
{
"name": "LayoutBlockFlow (relative positioned) DIV class='box gray force-layer'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#808080",
"transform": 4
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='first-green-box' class='box green rotate-45deg'",
"bounds": [102, 102],
"backgroundColor": "#008000",
"transform": 6
},
{
"name": "Squashing Containment Layer",
"position": [58, 230],
"drawsContent": false
},
{
"name": "LayoutBlockFlow (relative positioned) DIV class='box green rotate-45deg'",
"bounds": [102, 102],
"backgroundColor": "#008000",
"transform": 8
"name": "LayoutBlockFlow (relative positioned) DIV class='box gray force-layer'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#808080",
"transform": 4
},
{
"name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV class='box green')",
"position": [18, 570],
"bounds": [152, 222]
"name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV id='first-green-box' class='box green rotate-45deg')",
"position": [18, 328],
"bounds": [174, 464]
}
],
"transforms": [
Expand All @@ -157,45 +145,6 @@ After:
},
{
"id": 3,
"transform": [
[...],
[...],
[...],
[...]
]
},
{
"id": 4,
"parent": 3,
"transform": [
[...],
[...],
[...],
[...]
]
},
{
"id": 5,
"transform": [
[...],
[...],
[...],
[...]
]
},
{
"id": 6,
"parent": 5,
"transform": [
[...],
[...],
[...],
[...]
],
"origin": [51, 51]
},
{
"id": 7,
"transform": [
[...],
[...],
Expand All @@ -205,15 +154,14 @@ After:
"flattenInheritedTransform": false
},
{
"id": 8,
"parent": 7,
"id": 4,
"parent": 3,
"transform": [
[...],
[...],
[...],
[...]
],
"origin": [51, 51],
"flattenInheritedTransform": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
if (window.internals) {
var layers = JSON.parse(internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_DEBUG_INFO))["layers"];

// The scale-transform layer can't be squashed
assert_true(layers[3].compositingReasons[1] == "Layer was separately composited because it could not be squashed.");
assert_true(layers[3].squashingDisallowedReasons[0] == "Cannot squash layers with transforms that are not identity or translation.");

// ...but the translate-transform one can.
assert_true(layers[4].compositingReasons[0] == "Secondary layer, home for a group of squashable content");
// Both transformed layers squash together after the will-change layer.
assert_true(layers[2].compositingReasons[0] == "Has a will-change compositing hint");
assert_true(layers[3].compositingReasons[0] == "Secondary layer, home for a group of squashable content");
}
};
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@
"contentsOpaque": true,
"backgroundColor": "#FFFFFF"
},
{
"name": "LayoutBlockFlow (positioned) DIV class='composited box behind'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#0000FF",
"transform": 1
},
{
"name": "Squashing Containment Layer",
"drawsContent": false
},
{
"name": "LayoutBlockFlow (positioned) DIV class='box middle'",
"name": "LayoutBlockFlow (positioned) DIV class='composited box behind'",
"bounds": [100, 100],
"contentsOpaque": true,
"backgroundColor": "#00FF00",
"transform": 3
"backgroundColor": "#0000FF",
"transform": 1
},
{
"name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positioned) DIV class='box top')",
"position": [180, 180],
"bounds": [100, 100]
"name": "Squashing Layer (first squashed layer: LayoutBlockFlow (positioned) DIV class='box middle')",
"position": [-1, -1],
"bounds": [281, 281]
}
],
"transforms": [
Expand All @@ -38,28 +31,7 @@
[0, 1, 0, 0],
[0, 0, 1, 0],
[100, 100, 0, 1]
]
},
{
"id": 2,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[20, 20, 0, 1]
],
"flattenInheritedTransform": false
},
{
"id": 3,
"parent": 2,
"transform": [
[0.707106781186548, 0.707106781186548, 0, 0],
[-0.707106781186548, 0.707106781186548, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
],
"origin": [50, 50],
"flattenInheritedTransform": false
}
]
Expand Down
Loading

0 comments on commit 707023d

Please sign in to comment.