Commit 597b2a11 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[SPv175+] Optimize chunk rasterization on clip change

- When possible, detect chunk_to_layer_clip change;
- When possible, issue incremental raster invalidation on clip change.

Bug: 771643
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I8cea00f3c3ebcd035eae9bfcf29971a7a02a96df
Reviewed-on: https://chromium-review.googlesource.com/753540
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517912}
parent e349345e
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF"
},
{
"name": "LayoutBlockFlow DIV class='composited-child'",
"bounds": [100, 100],
"contentsOpaque": true,
"backfaceVisibility": "hidden",
"backgroundColor": "#008000"
},
{
"name": "Ancestor Clipping Layer",
"position": [0, 200],
"bounds": [200, 200],
"drawsContent": false
},
{
"name": "LayoutBlockFlow DIV class='composited-child'",
"position": [0, 200],
"bounds": [100, 100],
"contentsOpaque": true,
"backfaceVisibility": "hidden",
"backgroundColor": "#008000"
},
{
"name": "LayoutBlockFlow (relative positioned) DIV class='composited-child overflow-child'",
"position": [150, 150],
"bounds": [100, 100],
"contentsOpaque": true,
"backfaceVisibility": "hidden",
"backgroundColor": "#008000"
},
{
"name": "Ancestor Clipping Layer",
"position": [0, 200],
"bounds": [200, 200],
"drawsContent": false
},
{
"name": "LayoutBlockFlow (relative positioned) DIV class='composited-child overflow-child'",
"position": [150, 350],
"bounds": [100, 100],
"contentsOpaque": true,
"backfaceVisibility": "hidden",
"backgroundColor": "#008000"
}
],
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='overflow1'",
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV id='overflow2'",
"reason": "style change"
}
]
}
...@@ -8,33 +8,18 @@ ...@@ -8,33 +8,18 @@
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 105, 112], "rect": [8, 58, 105, 62],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutTextControl INPUT id='target'", "object": "LayoutTextControl INPUT id='target'",
"rect": [8, 8, 105, 112], "rect": [8, 58, 105, 62],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 105, 50], "rect": [10, 58, 1, 57],
"reason": "paint property change" "reason": "incremental"
},
{
"object": "LayoutTextControl INPUT id='target'",
"rect": [8, 8, 105, 50],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [10, 8, 1, 107],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [10, 8, 1, 50],
"reason": "paint property change"
} }
] ]
} }
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 300, 300], "rect": [8, 8, 300, 200],
"reason": "paint property change" "reason": "subtree"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 300, 200], "rect": [8, 208, 300, 100],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV id='s'",
"rect": [8, 156, 108, 108], "rect": [8, 156, 108, 108],
"reason": "paint property change" "reason": "geometry"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 156, 108, 56], "rect": [8, 212, 108, 52],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -7,14 +7,24 @@ ...@@ -7,14 +7,24 @@
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "InlineTextBox 'x'",
"rect": [8, 220, 100, 100], "rect": [8, 220, 100, 100],
"reason": "paint property change" "reason": "geometry"
},
{
"object": "InlineTextBox 'x'",
"rect": [8, 220, 100, 80],
"reason": "geometry"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [8, 300, 100, 20],
"reason": "incremental"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 200, 100, 100], "rect": [8, 200, 100, 20],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{ {
"object": "LayoutBlockFlow HTML", "object": "LayoutBlockFlow HTML",
"rect": [8, 300, 60, 22], "rect": [8, 300, 60, 22],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutView #document", "object": "LayoutView #document",
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"reason": "geometry" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRect rect id='targetRect'",
"rect": [9, 73, 400, 400], "rect": [9, 73, 400, 400],
"reason": "paint property change" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRoot svg",
"rect": [9, 73, 100, 400], "rect": [109, 73, 300, 400],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -12,14 +12,34 @@ ...@@ -12,14 +12,34 @@
"reason": "geometry" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGEllipse circle",
"rect": [47, 111, 324, 324], "rect": [47, 111, 324, 324],
"reason": "paint property change" "reason": "SVG resource change"
},
{
"object": "LayoutSVGRoot svg",
"rect": [47, 392, 324, 43],
"reason": "incremental"
},
{
"object": "LayoutSVGRoot svg",
"rect": [47, 111, 324, 43],
"reason": "incremental"
},
{
"object": "LayoutSVGRoot svg",
"rect": [110, 154, 261, 238],
"reason": "incremental"
},
{
"object": "LayoutSVGEllipse circle",
"rect": [8, 154, 170, 238],
"reason": "SVG resource change"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRoot svg",
"rect": [8, 154, 102, 238], "rect": [8, 154, 39, 238],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"reason": "geometry" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGImage image",
"rect": [9, 73, 400, 400], "rect": [9, 73, 400, 400],
"reason": "paint property change" "reason": "image"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRoot svg",
"rect": [9, 73, 100, 400], "rect": [109, 73, 300, 400],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
{ {
"object": "LayoutSVGRect rect id='targetRect1'", "object": "LayoutSVGRect rect id='targetRect1'",
"rect": [9, 73, 200, 200], "rect": [9, 73, 200, 200],
"reason": "paint property change" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGContainer use", "object": "LayoutSVGRect rect id='targetRect1'",
"rect": [59, 273, 50, 200], "rect": [59, 73, 150, 200],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutSVGRect rect id='targetRect1'", "object": "LayoutSVGContainer use",
"rect": [9, 73, 50, 200], "rect": [59, 273, 50, 200],
"reason": "paint property change" "reason": "paint property change"
} }
] ]
......
...@@ -162,11 +162,6 @@ CASE 4, overlap1 gets removed: ...@@ -162,11 +162,6 @@ CASE 4, overlap1 gets removed:
"position": [300, 300], "position": [300, 300],
"bounds": [100, 100], "bounds": [100, 100],
"paintInvalidations": [ "paintInvalidations": [
{
"object": "LayoutBlockFlow (positioned) DIV id='C' class='overlap3'",
"rect": [160, 160, 100, 100],
"reason": "paint property change"
},
{ {
"object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'", "object": "LayoutBlockFlow (positioned) DIV id='A' class='overlap1'",
"rect": [0, 0, 100, 100], "rect": [0, 0, 100, 100],
......
...@@ -8,33 +8,18 @@ ...@@ -8,33 +8,18 @@
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 105, 112], "rect": [8, 58, 105, 62],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutTextControl INPUT id='target'", "object": "LayoutTextControl INPUT id='target'",
"rect": [8, 8, 105, 112], "rect": [8, 58, 105, 62],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 105, 50], "rect": [10, 58, 1, 57],
"reason": "paint property change" "reason": "incremental"
},
{
"object": "LayoutTextControl INPUT id='target'",
"rect": [8, 8, 105, 50],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [10, 8, 1, 107],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [10, 8, 1, 50],
"reason": "paint property change"
} }
] ]
} }
......
...@@ -7,14 +7,9 @@ ...@@ -7,14 +7,9 @@
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV id='content'",
"rect": [8, 120, 100, 300], "rect": [8, 120, 100, 300],
"reason": "paint property change" "reason": "style change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [8, 120, 100, 100],
"reason": "paint property change"
} }
] ]
} }
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 300, 300], "rect": [8, 8, 300, 200],
"reason": "paint property change" "reason": "subtree"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 8, 300, 200], "rect": [8, 208, 300, 100],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -23,9 +23,14 @@ ...@@ -23,9 +23,14 @@
"bounds": [300, 654], "bounds": [300, 654],
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow HTML", "object": "InlineTextBox 'test1'",
"rect": [8, 508, 29, 19], "rect": [8, 508, 29, 19],
"reason": "paint property change" "reason": "appeared"
},
{
"object": "InlineTextBox 'test1'",
"rect": [8, 508, 29, 19],
"reason": "disappeared"
}, },
{ {
"object": "LayoutView #document", "object": "LayoutView #document",
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV id='s'",
"rect": [8, 156, 108, 108], "rect": [8, 156, 108, 108],
"reason": "paint property change" "reason": "geometry"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 156, 108, 56], "rect": [8, 212, 108, 52],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -7,14 +7,24 @@ ...@@ -7,14 +7,24 @@
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV", "object": "InlineTextBox 'x'",
"rect": [8, 220, 100, 100], "rect": [8, 220, 100, 100],
"reason": "paint property change" "reason": "geometry"
},
{
"object": "InlineTextBox 'x'",
"rect": [8, 220, 100, 80],
"reason": "geometry"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [8, 300, 100, 20],
"reason": "incremental"
}, },
{ {
"object": "LayoutBlockFlow DIV", "object": "LayoutBlockFlow DIV",
"rect": [8, 200, 100, 100], "rect": [8, 200, 100, 20],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute green reflected'", "object": "LayoutBlockFlow (positioned) DIV class='absolute green reflected'",
"rect": [250, 280, 100, 100], "rect": [250, 280, 100, 100],
"reason": "paint property change" "reason": "chunk reordered"
}, },
{ {
"object": "LayoutBlockFlow (positioned) DIV id='hideMe' class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV id='hideMe' class='absolute red'",
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{ {
"object": "LayoutBlockFlow HTML", "object": "LayoutBlockFlow HTML",
"rect": [8, 300, 60, 22], "rect": [8, 300, 60, 22],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutView #document", "object": "LayoutView #document",
......
...@@ -8,23 +8,13 @@ ...@@ -8,23 +8,13 @@
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV id='target'", "object": "LayoutBlockFlow DIV id='target'",
"rect": [8, 8, 100, 200], "rect": [8, 108, 100, 100],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutBlockFlow DIV id='target'", "object": "LayoutBlockFlow DIV id='target'",
"rect": [8, 8, 100, 200], "rect": [8, 108, 100, 100],
"reason": "paint property change" "reason": "incremental"
},
{
"object": "LayoutBlockFlow DIV id='target'",
"rect": [8, 8, 100, 100],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV id='target'",
"rect": [8, 8, 100, 100],
"reason": "paint property change"
} }
] ]
} }
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"reason": "geometry" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRect rect id='targetRect'",
"rect": [9, 73, 400, 400], "rect": [9, 73, 400, 400],
"reason": "paint property change" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRoot svg",
"rect": [9, 73, 100, 400], "rect": [109, 73, 300, 400],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -12,14 +12,34 @@ ...@@ -12,14 +12,34 @@
"reason": "geometry" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGEllipse circle",
"rect": [47, 111, 324, 324], "rect": [47, 111, 324, 324],
"reason": "paint property change" "reason": "SVG resource change"
},
{
"object": "LayoutSVGRoot svg",
"rect": [47, 392, 324, 43],
"reason": "incremental"
},
{
"object": "LayoutSVGRoot svg",
"rect": [47, 111, 324, 43],
"reason": "incremental"
},
{
"object": "LayoutSVGRoot svg",
"rect": [110, 154, 261, 238],
"reason": "incremental"
},
{
"object": "LayoutSVGEllipse circle",
"rect": [8, 154, 170, 238],
"reason": "SVG resource change"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRoot svg",
"rect": [8, 154, 102, 238], "rect": [8, 154, 39, 238],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
"reason": "geometry" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGImage image",
"rect": [9, 73, 400, 400], "rect": [9, 73, 400, 400],
"reason": "paint property change" "reason": "image"
}, },
{ {
"object": "LayoutSVGRoot svg", "object": "LayoutSVGRoot svg",
"rect": [9, 73, 100, 400], "rect": [109, 73, 300, 400],
"reason": "paint property change" "reason": "incremental"
} }
] ]
} }
......
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
{ {
"object": "LayoutSVGRect rect id='targetRect1'", "object": "LayoutSVGRect rect id='targetRect1'",
"rect": [9, 73, 200, 200], "rect": [9, 73, 200, 200],
"reason": "paint property change" "reason": "geometry"
}, },
{ {
"object": "LayoutSVGContainer use", "object": "LayoutSVGRect rect id='targetRect1'",
"rect": [59, 273, 50, 200], "rect": [59, 73, 150, 200],
"reason": "paint property change" "reason": "incremental"
}, },
{ {
"object": "LayoutSVGRect rect id='targetRect1'", "object": "LayoutSVGContainer use",
"rect": [9, 73, 50, 200], "rect": [59, 273, 50, 200],
"reason": "paint property change" "reason": "paint property change"
} }
] ]
......
...@@ -13,10 +13,20 @@ ...@@ -13,10 +13,20 @@
"backfaceVisibility": "hidden", "backfaceVisibility": "hidden",
"backgroundColor": "#FFFF00", "backgroundColor": "#FFFF00",
"paintInvalidations": [ "paintInvalidations": [
{
"object": "LayoutBlockFlow (positioned) DIV id='target'",
"rect": [0, 0, 402, 542],
"reason": "paint property change"
},
{ {
"object": "LayoutBlockFlow (positioned) DIV id='target'", "object": "LayoutBlockFlow (positioned) DIV id='target'",
"rect": [0, 0, 200, 200], "rect": [0, 0, 200, 200],
"reason": "full" "reason": "full"
},
{
"object": "LayoutBlockFlow (positioned) DIV id='target'",
"rect": [0, 0, 200, 200],
"reason": "paint property change"
} }
] ]
}, },
......
...@@ -26,16 +26,6 @@ ...@@ -26,16 +26,6 @@
"position": [8, 8], "position": [8, 8],
"bounds": [700, 525], "bounds": [700, 525],
"paintInvalidations": [ "paintInvalidations": [
{
"object": "LayoutFlexibleBox (relative positioned) DIV",
"rect": [0, 493, 700, 32],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow (positioned) DIV",
"rect": [108, 508, 404, 2],
"reason": "paint property change"
},
{ {
"object": "LayoutBlockFlow (positioned) DIV", "object": "LayoutBlockFlow (positioned) DIV",
"rect": [580, 508, 70, 2], "rect": [580, 508, 70, 2],
...@@ -44,17 +34,17 @@ ...@@ -44,17 +34,17 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV id='thumb'", "object": "LayoutBlockFlow (positioned) DIV id='thumb'",
"rect": [632, 493, 36, 32], "rect": [632, 493, 36, 32],
"reason": "paint property change" "reason": "full"
}, },
{ {
"object": "LayoutBlockFlow (positioned) DIV id='thumb'", "object": "LayoutBlockFlow (positioned) DIV id='thumb'",
"rect": [562, 493, 36, 32], "rect": [562, 493, 36, 32],
"reason": "paint property change" "reason": "full"
}, },
{ {
"object": "LayoutBlockFlow (positioned) DIV id='thumb'", "object": "LayoutButton INPUT class='muted'",
"rect": [90, 493, 36, 32], "rect": [530, 493, 32, 32],
"reason": "paint property change" "reason": "full"
} }
] ]
} }
......
...@@ -26,35 +26,25 @@ ...@@ -26,35 +26,25 @@
"position": [8, 8], "position": [8, 8],
"bounds": [700, 525], "bounds": [700, 525],
"paintInvalidations": [ "paintInvalidations": [
{
"object": "LayoutFlexibleBox (relative positioned) DIV",
"rect": [0, 493, 700, 32],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow (positioned) DIV",
"rect": [108, 508, 404, 2],
"reason": "paint property change"
},
{ {
"object": "LayoutBlockFlow (positioned) DIV id='thumb'", "object": "LayoutBlockFlow (positioned) DIV id='thumb'",
"rect": [597, 493, 36, 32], "rect": [597, 493, 36, 32],
"reason": "paint property change" "reason": "full"
}, },
{ {
"object": "LayoutBlockFlow (positioned) DIV id='thumb'", "object": "LayoutBlockFlow (positioned) DIV id='thumb'",
"rect": [562, 493, 36, 32], "rect": [562, 493, 36, 32],
"reason": "paint property change" "reason": "full"
},
{
"object": "LayoutBlockFlow (positioned) DIV id='thumb'",
"rect": [90, 493, 36, 32],
"reason": "paint property change"
}, },
{ {
"object": "LayoutBlockFlow (positioned) DIV", "object": "LayoutBlockFlow (positioned) DIV",
"rect": [580, 508, 35, 2], "rect": [580, 508, 35, 2],
"reason": "appeared" "reason": "appeared"
},
{
"object": "LayoutButton INPUT",
"rect": [530, 493, 32, 32],
"reason": "full"
} }
] ]
} }
......
...@@ -23,12 +23,12 @@ ...@@ -23,12 +23,12 @@
}, },
{ {
"object": "LayoutView #document", "object": "LayoutView #document",
"rect": [0, 0, 600, 500], "rect": [0, 0, 600, 235],
"reason": "paint property change" "reason": "paint property change"
}, },
{ {
"object": "LayoutBlockFlow HTML", "object": "LayoutBlockFlow HTML",
"rect": [168, 8, 423, 482], "rect": [168, 8, 423, 227],
"reason": "paint property change" "reason": "paint property change"
} }
], ],
...@@ -257,17 +257,17 @@ ...@@ -257,17 +257,17 @@
}, },
{ {
"object": "LayoutView #document", "object": "LayoutView #document",
"rect": [0, 0, 939, 235], "rect": [0, 0, 400, 600],
"reason": "paint property change" "reason": "paint property change"
}, },
{ {
"object": "LayoutBlockFlow HTML", "object": "LayoutView #document",
"rect": [10, 7, 920, 213], "rect": [0, 0, 400, 235],
"reason": "paint property change" "reason": "paint property change"
}, },
{ {
"object": "LayoutView #document", "object": "LayoutBlockFlow HTML",
"rect": [0, 0, 400, 600], "rect": [10, 7, 390, 213],
"reason": "paint property change" "reason": "paint property change"
}, },
{ {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef CompositedLayerRasterInvalidator_h #ifndef CompositedLayerRasterInvalidator_h
#define CompositedLayerRasterInvalidator_h #define CompositedLayerRasterInvalidator_h
#include "platform/graphics/paint/FloatClipRect.h"
#include "platform/graphics/paint/PaintChunk.h" #include "platform/graphics/paint/PaintChunk.h"
#include "platform/graphics/paint/RasterInvalidationTracking.h" #include "platform/graphics/paint/RasterInvalidationTracking.h"
#include "platform/wtf/HashMap.h" #include "platform/wtf/HashMap.h"
...@@ -46,12 +47,16 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator { ...@@ -46,12 +47,16 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator {
const gfx::Rect& LayerBounds() const { return layer_bounds_; } const gfx::Rect& LayerBounds() const { return layer_bounds_; }
private: private:
friend class CompositedLayerRasterInvalidatorTest;
struct PaintChunkInfo { struct PaintChunkInfo {
PaintChunkInfo(const IntRect& bounds, PaintChunkInfo(const IntRect& bounds,
const TransformationMatrix& chunk_to_layer_transform, const TransformationMatrix& chunk_to_layer_transform,
const FloatClipRect& chunk_to_layer_clip,
const PaintChunk& chunk) const PaintChunk& chunk)
: bounds_in_layer(bounds), : bounds_in_layer(bounds),
chunk_to_layer_transform(chunk_to_layer_transform), chunk_to_layer_transform(chunk_to_layer_transform),
chunk_to_layer_clip(chunk_to_layer_clip),
id(chunk.id), id(chunk.id),
is_cacheable(chunk.is_cacheable), is_cacheable(chunk.is_cacheable),
properties(chunk.properties) {} properties(chunk.properties) {}
...@@ -62,6 +67,7 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator { ...@@ -62,6 +67,7 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator {
IntRect bounds_in_layer; IntRect bounds_in_layer;
TransformationMatrix chunk_to_layer_transform; TransformationMatrix chunk_to_layer_transform;
FloatClipRect chunk_to_layer_clip;
PaintChunk::Id id; PaintChunk::Id id;
bool is_cacheable; bool is_cacheable;
PaintChunkProperties properties; PaintChunkProperties properties;
...@@ -69,18 +75,36 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator { ...@@ -69,18 +75,36 @@ class PLATFORM_EXPORT CompositedLayerRasterInvalidator {
IntRect MapRectFromChunkToLayer(const FloatRect&, const PaintChunk&) const; IntRect MapRectFromChunkToLayer(const FloatRect&, const PaintChunk&) const;
TransformationMatrix ChunkToLayerTransform(const PaintChunk&) const; TransformationMatrix ChunkToLayerTransform(const PaintChunk&) const;
FloatClipRect ChunkToLayerClip(const PaintChunk&) const;
void GenerateRasterInvalidations( void GenerateRasterInvalidations(
const Vector<const PaintChunk*>& new_chunks, const Vector<const PaintChunk*>& new_chunks,
const Vector<PaintChunkInfo>& new_chunks_info); const Vector<PaintChunkInfo>& new_chunks_info);
size_t MatchNewChunkToOldChunk(const PaintChunk& new_chunk, size_t old_index); size_t MatchNewChunkToOldChunk(const PaintChunk& new_chunk, size_t old_index);
void AddDisplayItemRasterInvalidations(const PaintChunk&); void AddDisplayItemRasterInvalidations(const PaintChunk&);
void InvalidateRasterForNewChunk(const PaintChunkInfo&, void IncrementallyInvalidateChunk(const PaintChunkInfo& old_chunk,
PaintInvalidationReason); const PaintChunkInfo& new_chunk);
void InvalidateRasterForOldChunk(const PaintChunkInfo&, void FullyInvalidateChunk(const PaintChunkInfo& old_chunk,
PaintInvalidationReason); const PaintChunkInfo& new_chunk,
bool ChunkPropertiesChanged(const PaintChunkInfo& new_chunk, PaintInvalidationReason);
const PaintChunkInfo& old_chunk) const; ALWAYS_INLINE void FullyInvalidateNewChunk(const PaintChunkInfo&,
PaintInvalidationReason);
ALWAYS_INLINE void FullyInvalidateOldChunk(const PaintChunkInfo&,
PaintInvalidationReason);
ALWAYS_INLINE void AddRasterInvalidation(const IntRect&,
const DisplayItemClient*,
PaintInvalidationReason,
const String* debug_name = nullptr);
PaintInvalidationReason ChunkPropertiesChanged(
const PaintChunkInfo& new_chunk,
const PaintChunkInfo& old_chunk) const;
// Clip a rect in the layer space by the layer bounds.
template <typename Rect>
Rect ClipByLayerBounds(const Rect& r) const {
return Intersection(
r, Rect(0, 0, layer_bounds_.width(), layer_bounds_.height()));
}
RasterInvalidationFunction raster_invalidation_function_; RasterInvalidationFunction raster_invalidation_function_;
gfx::Rect layer_bounds_; gfx::Rect layer_bounds_;
......
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