Commit 44ab2704 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[RasterInvalidation] Track explicit and implicit full composited layer invalidation

1. For explicit full composited layer invalidation (Pre-SPv2 only) which
is issued by GraphicsLayer::SetNeedsDisplay():
  - Use more descriptive reason kFullLayer instead of kFull;
  - Clear RasterInvalidator old states which are stale

2. Track implicit full composited layer invalidation (Pre-SPv2 and
SPv2) which happens when a layer is newly created or becomes non empty.
We don't issue raster invaidation because the new tiles are invalid
initially. However, it's a performance overhead when we unnecessarily
re-create a composited layer e.g. just because the layer's id changed
(crbug.com/842356), and we need to expose this overhead in layout test
results.

Bug: 842356
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I2ffcfa9dbc43668f57b0ea84795d3b0fbcb7b9c6
Reviewed-on: https://chromium-review.googlesource.com/1112300Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569855}
parent 900f4106
...@@ -113,7 +113,7 @@ CASE 2, scrolling y to 80, new layers will be squashed, so things repaint: ...@@ -113,7 +113,7 @@ CASE 2, scrolling y to 80, new layers will be squashed, so things repaint:
{ {
"object": "LayoutBlockFlow (relative positioned) DIV id='paragraph-c' class='overlapping cyan'", "object": "LayoutBlockFlow (relative positioned) DIV id='paragraph-c' class='overlapping cyan'",
"rect": [0, 0, 200, 100], "rect": [0, 0, 200, 100],
"reason": "full" "reason": "full layer"
} }
], ],
"transform": 1 "transform": 1
...@@ -122,6 +122,13 @@ CASE 2, scrolling y to 80, new layers will be squashed, so things repaint: ...@@ -122,6 +122,13 @@ CASE 2, scrolling y to 80, new layers will be squashed, so things repaint:
"name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV id='paragraph-d' class='overlapping lime')", "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV id='paragraph-d' class='overlapping lime')",
"position": [0, 300], "position": [0, 300],
"bounds": [200, 300], "bounds": [200, 300],
"paintInvalidations": [
{
"object": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV id='paragraph-d' class='overlapping lime')",
"rect": [0, 0, 200, 300],
"reason": "full layer"
}
],
"transform": 1 "transform": 1
} }
], ],
...@@ -296,7 +303,7 @@ CASE 4, scrolling y to 170 new layers will be squashed, so things repaint: ...@@ -296,7 +303,7 @@ CASE 4, scrolling y to 170 new layers will be squashed, so things repaint:
{ {
"object": "LayoutBlockFlow (relative positioned) DIV id='paragraph-d' class='overlapping lime'", "object": "LayoutBlockFlow (relative positioned) DIV id='paragraph-d' class='overlapping lime'",
"rect": [0, 0, 200, 100], "rect": [0, 0, 200, 100],
"reason": "full" "reason": "full layer"
} }
], ],
"transform": 1 "transform": 1
...@@ -305,6 +312,13 @@ CASE 4, scrolling y to 170 new layers will be squashed, so things repaint: ...@@ -305,6 +312,13 @@ CASE 4, scrolling y to 170 new layers will be squashed, so things repaint:
"name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV id='paragraph-e' class='overlapping cyan')", "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV id='paragraph-e' class='overlapping cyan')",
"position": [0, 400], "position": [0, 400],
"bounds": [200, 300], "bounds": [200, 300],
"paintInvalidations": [
{
"object": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV id='paragraph-e' class='overlapping cyan')",
"rect": [0, 0, 200, 300],
"reason": "full layer"
}
],
"transform": 1 "transform": 1
} }
], ],
......
...@@ -18,6 +18,13 @@ ...@@ -18,6 +18,13 @@
"position": [-30, -30], "position": [-30, -30],
"bounds": [260, 260], "bounds": [260, 260],
"backgroundColor": "#008000", "backgroundColor": "#008000",
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='box' class='green box blurry'",
"rect": [0, 0, 260, 260],
"reason": "full layer"
}
],
"transform": 1 "transform": 1
} }
], ],
......
...@@ -10,7 +10,14 @@ ...@@ -10,7 +10,14 @@
"name": "LayoutTableRow TR id='target'", "name": "LayoutTableRow TR id='target'",
"position": [8, 96], "position": [8, 96],
"bounds": [186, 64], "bounds": [186, 64],
"backgroundColor": "#ADD8E6" "backgroundColor": "#ADD8E6",
"paintInvalidations": [
{
"object": "LayoutTableRow TR id='target'",
"rect": [0, 0, 186, 64],
"reason": "full layer"
}
]
}, },
{ {
"name": "LayoutTableCell TD", "name": "LayoutTableCell TD",
......
...@@ -10,7 +10,14 @@ ...@@ -10,7 +10,14 @@
"name": "LayoutTableSection TBODY id='target'", "name": "LayoutTableSection TBODY id='target'",
"position": [8, 28], "position": [8, 28],
"bounds": [186, 134], "bounds": [186, 134],
"backgroundColor": "#ADD8E6" "backgroundColor": "#ADD8E6",
"paintInvalidations": [
{
"object": "LayoutTableSection TBODY id='target'",
"rect": [0, 0, 186, 134],
"reason": "full layer"
}
]
}, },
{ {
"name": "LayoutTableRow TR", "name": "LayoutTableRow TR",
......
...@@ -10,7 +10,14 @@ ...@@ -10,7 +10,14 @@
"name": "LayoutTableSection TBODY id='target'", "name": "LayoutTableSection TBODY id='target'",
"position": [8, 28], "position": [8, 28],
"bounds": [186, 134], "bounds": [186, 134],
"backgroundColor": "#ADD8E6" "backgroundColor": "#ADD8E6",
"paintInvalidations": [
{
"object": "LayoutTableSection TBODY id='target'",
"rect": [0, 0, 186, 134],
"reason": "full layer"
}
]
}, },
{ {
"name": "LayoutTableCell TD", "name": "LayoutTableCell TD",
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
{ {
"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 layer"
} }
], ],
"transform": 2 "transform": 2
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
{ {
"object": "LayoutBlockFlow DIV id='target'", "object": "LayoutBlockFlow DIV id='target'",
"rect": [0, 0, 200, 200], "rect": [0, 0, 200, 200],
"reason": "full" "reason": "full layer"
} }
] ]
} }
......
...@@ -25,12 +25,7 @@ ...@@ -25,12 +25,7 @@
{ {
"object": "LayoutBlockFlow DIV id='target'", "object": "LayoutBlockFlow DIV id='target'",
"rect": [0, 0, 100, 100], "rect": [0, 0, 100, 100],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutBlockFlow DIV id='target'",
"rect": [0, 30, 50, 50],
"reason": "chunk appeared"
} }
] ]
}, },
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 185], "rect": [0, 0, 15, 185],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
{ {
"object": "LayoutHTMLCanvas (positioned) CANVAS", "object": "LayoutHTMLCanvas (positioned) CANVAS",
"rect": [0, 0, 200, 200], "rect": [0, 0, 200, 200],
"reason": "full" "reason": "full layer"
} }
] ]
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
{ {
"object": "Horizontal Scrollbar Layer", "object": "Horizontal Scrollbar Layer",
"rect": [0, 0, 385, 15], "rect": [0, 0, 385, 15],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 285], "rect": [0, 0, 15, 285],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
......
...@@ -28,17 +28,12 @@ ...@@ -28,17 +28,12 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV id='composited-box'", "object": "LayoutBlockFlow (positioned) DIV id='composited-box'",
"rect": [0, 0, 20, 70], "rect": [0, 0, 20, 70],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"object": "LayoutBlockFlow (positioned) DIV id='composited-box'", "object": "LayoutBlockFlow (positioned) DIV id='composited-box'",
"rect": [0, 0, 10, 60], "rect": [0, 0, 10, 60],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutBlockFlow (positioned) DIV id='composited-box'",
"rect": [0, 0, 10, 60],
"reason": "paint property change"
} }
] ]
}, },
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 185], "rect": [0, 0, 15, 185],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
{ {
"object": "LayoutBlockFlow DIV id='box' class='green box blurry'", "object": "LayoutBlockFlow DIV id='box' class='green box blurry'",
"rect": [0, 0, 200, 200], "rect": [0, 0, 200, 200],
"reason": "full" "reason": "full layer"
} }
], ],
"transform": 1 "transform": 1
......
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
"paintInvalidations": [ "paintInvalidations": [
{ {
"object": "LayoutBlockFlow DIV id='parent'", "object": "LayoutBlockFlow DIV id='parent'",
"rect": [0, 0, 744, 100], "rect": [0, 0, 745, 102],
"reason": "full" "reason": "full layer"
}, },
{ {
"object": "LayoutBlockFlow DIV id='parent'", "object": "LayoutBlockFlow DIV id='parent'",
"rect": [0, 0, 102, 102], "rect": [0, 0, 744, 100],
"reason": "chunk appeared" "reason": "full layer"
} }
], ],
"transform": 1 "transform": 1
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
{ {
"object": "Scroll Corner Layer", "object": "Scroll Corner Layer",
"rect": [0, 0, 15, 15], "rect": [0, 0, 15, 15],
"reason": "full" "reason": "full layer"
} }
] ]
} }
......
...@@ -27,12 +27,12 @@ ...@@ -27,12 +27,12 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV", "object": "LayoutBlockFlow (positioned) DIV",
"rect": [0, 0, 200, 200], "rect": [0, 0, 200, 200],
"reason": "full" "reason": "full layer"
}, },
{ {
"object": "LayoutBlockFlow (positioned) DIV", "object": "LayoutBlockFlow (positioned) DIV",
"rect": [0, 0, 200, 200], "rect": [0, 0, 200, 200],
"reason": "full" "reason": "full layer"
} }
] ]
} }
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
{ {
"object": "Horizontal Scrollbar Layer", "object": "Horizontal Scrollbar Layer",
"rect": [0, 0, 400, 15], "rect": [0, 0, 400, 15],
"reason": "full" "reason": "full layer"
} }
] ]
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 200], "rect": [0, 0, 15, 200],
"reason": "full" "reason": "full layer"
} }
] ]
} }
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 385], "rect": [0, 0, 15, 385],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 385], "rect": [0, 0, 15, 385],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
......
...@@ -26,32 +26,12 @@ ...@@ -26,32 +26,12 @@
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 63, 24], "rect": [0, 0, 63, 24],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 61, 22], "rect": [0, 0, 61, 22],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 61, 22],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [2, 3, 57, 16],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 4, 56, 16],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [58, 4, 1, 16],
"reason": "chunk appeared"
} }
] ]
} }
......
...@@ -26,32 +26,12 @@ ...@@ -26,32 +26,12 @@
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 63, 24], "rect": [0, 0, 63, 24],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 61, 22], "rect": [0, 0, 61, 22],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 61, 22],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [2, 3, 57, 16],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 4, 56, 16],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [58, 4, 1, 16],
"reason": "chunk appeared"
} }
] ]
} }
......
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"drawsContent": false,
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF"
},
{
"name": "LayoutTextControl INPUT id='root'",
"position": [5, 5],
"bounds": [47, 25],
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 47, 25],
"reason": "paint property change"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19],
"reason": "full"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [6, 6, 35, 13],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 3, 35, 13],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [39, 6, 1, 13],
"reason": "chunk appeared"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutTextControl INPUT id='root'",
"reason": "subtree"
},
{
"object": "LayoutBlockFlow DIV",
"reason": "subtree"
},
{
"object": "RootInlineBox",
"reason": "subtree"
},
{
"object": "Caret",
"reason": "caret"
},
{
"object": "LayoutText #text",
"reason": "subtree"
},
{
"object": "InlineTextBox 'test test test'",
"reason": "subtree"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"drawsContent": false,
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF"
},
{
"name": "LayoutTextControl INPUT id='root'",
"position": [5, 5],
"bounds": [47, 25],
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 47, 25],
"reason": "paint property change"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19],
"reason": "full"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [6, 6, 35, 13],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 3, 35, 13],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [39, 6, 1, 13],
"reason": "chunk appeared"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutTextControl INPUT id='root'",
"reason": "subtree"
},
{
"object": "LayoutBlockFlow DIV",
"reason": "subtree"
},
{
"object": "RootInlineBox",
"reason": "subtree"
},
{
"object": "Caret",
"reason": "caret"
},
{
"object": "LayoutText #text",
"reason": "subtree"
},
{
"object": "InlineTextBox 'test test test'",
"reason": "subtree"
}
]
}
...@@ -26,32 +26,12 @@ ...@@ -26,32 +26,12 @@
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 47, 25], "rect": [0, 0, 47, 25],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19], "rect": [0, 0, 41, 19],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 3, 35, 13],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [6, 6, 34, 13],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [39, 6, 1, 13],
"reason": "chunk appeared"
} }
] ]
} }
......
...@@ -26,32 +26,12 @@ ...@@ -26,32 +26,12 @@
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 47, 25], "rect": [0, 0, 47, 25],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19], "rect": [0, 0, 41, 19],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 41, 19],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 3, 35, 13],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [6, 6, 34, 13],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [39, 6, 1, 13],
"reason": "chunk appeared"
} }
] ]
} }
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
{ {
"object": "Horizontal Scrollbar Layer", "object": "Horizontal Scrollbar Layer",
"rect": [0, 0, 185, 15], "rect": [0, 0, 185, 15],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
...@@ -72,12 +72,12 @@ ...@@ -72,12 +72,12 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 185], "rect": [0, 0, 15, 185],
"reason": "full" "reason": "full layer"
}, },
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 185], "rect": [0, 0, 15, 185],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
......
...@@ -27,17 +27,12 @@ ...@@ -27,17 +27,12 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV id='target'", "object": "LayoutBlockFlow (positioned) DIV id='target'",
"rect": [0, 0, 406, 546], "rect": [0, 0, 406, 546],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"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 layer"
},
{
"object": "LayoutBlockFlow (positioned) DIV id='target'",
"rect": [0, 0, 200, 200],
"reason": "paint property change"
} }
] ]
}, },
......
...@@ -26,32 +26,12 @@ ...@@ -26,32 +26,12 @@
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 70, 24], "rect": [0, 0, 70, 24],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 68, 22], "rect": [0, 0, 68, 22],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 68, 22],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [2, 3, 64, 16],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 4, 63, 16],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [65, 4, 1, 16],
"reason": "chunk appeared"
} }
] ]
} }
......
...@@ -26,32 +26,12 @@ ...@@ -26,32 +26,12 @@
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 70, 24], "rect": [0, 0, 70, 24],
"reason": "paint property change" "reason": "full layer"
}, },
{ {
"object": "LayoutTextControl INPUT id='root'", "object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 68, 22], "rect": [0, 0, 68, 22],
"reason": "full" "reason": "full layer"
},
{
"object": "LayoutTextControl INPUT id='root'",
"rect": [0, 0, 68, 22],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [2, 3, 64, 16],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [3, 4, 63, 16],
"reason": "paint property change"
},
{
"object": "Caret",
"rect": [65, 4, 1, 16],
"reason": "chunk appeared"
} }
] ]
} }
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
{ {
"object": "Horizontal Scrollbar Layer", "object": "Horizontal Scrollbar Layer",
"rect": [0, 0, 185, 15], "rect": [0, 0, 185, 15],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
...@@ -72,12 +72,12 @@ ...@@ -72,12 +72,12 @@
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 185], "rect": [0, 0, 15, 185],
"reason": "full" "reason": "full layer"
}, },
{ {
"object": "Vertical Scrollbar Layer", "object": "Vertical Scrollbar Layer",
"rect": [0, 0, 15, 185], "rect": [0, 0, 15, 185],
"reason": "full" "reason": "full layer"
} }
] ]
}, },
......
...@@ -387,7 +387,7 @@ void LinkHighlightImpl::UpdateGeometry() { ...@@ -387,7 +387,7 @@ void LinkHighlightImpl::UpdateGeometry() {
gfx::RectF(Layer()->position(), gfx::SizeF(Layer()->bounds()))); gfx::RectF(Layer()->position(), gfx::SizeF(Layer()->bounds())));
current_graphics_layer_->TrackRasterInvalidation( current_graphics_layer_->TrackRasterInvalidation(
LinkHighlightDisplayItemClientForTracking(), IntRect(rect), LinkHighlightDisplayItemClientForTracking(), IntRect(rect),
PaintInvalidationReason::kFull); PaintInvalidationReason::kFullLayer);
} }
} }
} else { } else {
......
...@@ -362,7 +362,7 @@ bool GraphicsLayer::Paint(const IntRect* interest_rect, ...@@ -362,7 +362,7 @@ bool GraphicsLayer::Paint(const IntRect* interest_rect,
IntRect layer_bounds(layer_state_->offset, Size()); IntRect layer_bounds(layer_state_->offset, Size());
EnsureRasterInvalidator().Generate(GetPaintController().GetPaintArtifact(), EnsureRasterInvalidator().Generate(GetPaintController().GetPaintArtifact(),
layer_bounds, layer_state_->state, layer_bounds, layer_state_->state,
VisualRectSubpixelOffset()); VisualRectSubpixelOffset(), this);
} }
if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() && if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled() &&
...@@ -636,8 +636,9 @@ void GraphicsLayer::TrackRasterInvalidation(const DisplayItemClient& client, ...@@ -636,8 +636,9 @@ void GraphicsLayer::TrackRasterInvalidation(const DisplayItemClient& client,
if (RasterInvalidationTracking::ShouldAlwaysTrack()) if (RasterInvalidationTracking::ShouldAlwaysTrack())
EnsureRasterInvalidator().EnsureTracking(); EnsureRasterInvalidator().EnsureTracking();
// For SPv175, this only tracks invalidations that the cc::Layer is fully // This only tracks invalidations that the cc::Layer is fully invalidated
// invalidated directly, e.g. from SetContentsNeedsDisplay(), etc. // directly, e.g. from SetContentsNeedsDisplay(), etc. Other raster
// invalidations are tracked in RasterInvalidator.
if (auto* tracking = GetRasterInvalidationTracking()) if (auto* tracking = GetRasterInvalidationTracking())
tracking->AddInvalidation(&client, client.DebugName(), rect, reason); tracking->AddInvalidation(&client, client.DebugName(), rect, reason);
} }
...@@ -1157,7 +1158,7 @@ void GraphicsLayer::SetContentsNeedsDisplay() { ...@@ -1157,7 +1158,7 @@ void GraphicsLayer::SetContentsNeedsDisplay() {
if (cc::Layer* contents_layer = ContentsLayerIfRegistered()) { if (cc::Layer* contents_layer = ContentsLayerIfRegistered()) {
contents_layer->SetNeedsDisplay(); contents_layer->SetNeedsDisplay();
TrackRasterInvalidation(*this, contents_rect_, TrackRasterInvalidation(*this, contents_rect_,
PaintInvalidationReason::kFull); PaintInvalidationReason::kFullLayer);
} }
} }
...@@ -1170,10 +1171,14 @@ void GraphicsLayer::SetNeedsDisplay() { ...@@ -1170,10 +1171,14 @@ void GraphicsLayer::SetNeedsDisplay() {
layer_->SetNeedsDisplay(); layer_->SetNeedsDisplay();
for (size_t i = 0; i < link_highlights_.size(); ++i) for (size_t i = 0; i < link_highlights_.size(); ++i)
link_highlights_[i]->Invalidate(); link_highlights_[i]->Invalidate();
GetPaintController().InvalidateAll(); GetPaintController().InvalidateAll();
if (raster_invalidator_)
raster_invalidator_->ClearOldStates();
TrackRasterInvalidation(*this, IntRect(IntPoint(), size_), TrackRasterInvalidation(*this, IntRect(IntPoint(), size_),
PaintInvalidationReason::kFull); PaintInvalidationReason::kFullLayer);
} }
DISABLE_CFI_PERF DISABLE_CFI_PERF
......
...@@ -277,16 +277,18 @@ RasterInvalidationTracking& RasterInvalidator::EnsureTracking() { ...@@ -277,16 +277,18 @@ RasterInvalidationTracking& RasterInvalidator::EnsureTracking() {
void RasterInvalidator::Generate(const PaintArtifact& paint_artifact, void RasterInvalidator::Generate(const PaintArtifact& paint_artifact,
const gfx::Rect& layer_bounds, const gfx::Rect& layer_bounds,
const PropertyTreeState& layer_state, const PropertyTreeState& layer_state,
const FloatSize& visual_rect_subpixel_offset) { const FloatSize& visual_rect_subpixel_offset,
const DisplayItemClient* layer_client) {
Generate(paint_artifact, paint_artifact.PaintChunks(), layer_bounds, Generate(paint_artifact, paint_artifact.PaintChunks(), layer_bounds,
layer_state, visual_rect_subpixel_offset); layer_state, visual_rect_subpixel_offset, layer_client);
} }
void RasterInvalidator::Generate(const PaintArtifact& paint_artifact, void RasterInvalidator::Generate(const PaintArtifact& paint_artifact,
const PaintChunkSubset& paint_chunks, const PaintChunkSubset& paint_chunks,
const gfx::Rect& layer_bounds, const gfx::Rect& layer_bounds,
const PropertyTreeState& layer_state, const PropertyTreeState& layer_state,
const FloatSize& visual_rect_subpixel_offset) { const FloatSize& visual_rect_subpixel_offset,
const DisplayItemClient* layer_client) {
if (RasterInvalidationTracking::ShouldAlwaysTrack()) if (RasterInvalidationTracking::ShouldAlwaysTrack())
EnsureTracking(); EnsureTracking();
...@@ -313,6 +315,12 @@ void RasterInvalidator::Generate(const PaintArtifact& paint_artifact, ...@@ -313,6 +315,12 @@ void RasterInvalidator::Generate(const PaintArtifact& paint_artifact,
mapper.SwitchToChunk(chunk); mapper.SwitchToChunk(chunk);
new_chunks_info.emplace_back(*this, mapper, chunk); new_chunks_info.emplace_back(*this, mapper, chunk);
} }
if (tracking_info_ && layer_bounds_was_empty && !layer_bounds.IsEmpty() &&
paint_chunks.size()) {
TrackImplicitFullLayerInvalidation(
layer_client ? *layer_client : paint_chunks[0].id.client);
}
} else { } else {
GenerateRasterInvalidations(paint_artifact, paint_chunks, layer_state, GenerateRasterInvalidations(paint_artifact, paint_chunks, layer_state,
visual_rect_subpixel_offset, new_chunks_info); visual_rect_subpixel_offset, new_chunks_info);
...@@ -326,8 +334,29 @@ void RasterInvalidator::Generate(const PaintArtifact& paint_artifact, ...@@ -326,8 +334,29 @@ void RasterInvalidator::Generate(const PaintArtifact& paint_artifact,
} }
} }
void RasterInvalidator::TrackImplicitFullLayerInvalidation(
const DisplayItemClient& layer_client) {
DCHECK(tracking_info_);
// Early return if we have already invalidated the whole layer.
IntRect full_layer_rect(0, 0, layer_bounds_.width(), layer_bounds_.height());
for (const auto& invalidation : tracking_info_->tracking.Invalidations()) {
if (invalidation.rect.Contains(full_layer_rect))
return;
}
tracking_info_->tracking.AddInvalidation(
&layer_client, layer_client.DebugName(), full_layer_rect,
PaintInvalidationReason::kFullLayer);
}
size_t RasterInvalidator::ApproximateUnsharedMemoryUsage() const { size_t RasterInvalidator::ApproximateUnsharedMemoryUsage() const {
return sizeof(*this) + paint_chunks_info_.capacity() * sizeof(PaintChunkInfo); return sizeof(*this) + paint_chunks_info_.capacity() * sizeof(PaintChunkInfo);
} }
void RasterInvalidator::ClearOldStates() {
paint_chunks_info_.clear();
layer_bounds_ = gfx::Rect();
}
} // namespace blink } // namespace blink
...@@ -37,7 +37,8 @@ class PLATFORM_EXPORT RasterInvalidator { ...@@ -37,7 +37,8 @@ class PLATFORM_EXPORT RasterInvalidator {
void Generate(const PaintArtifact&, void Generate(const PaintArtifact&,
const gfx::Rect& layer_bounds, const gfx::Rect& layer_bounds,
const PropertyTreeState& layer_state, const PropertyTreeState& layer_state,
const FloatSize& visual_rect_subpixel_offset = FloatSize()); const FloatSize& visual_rect_subpixel_offset = FloatSize(),
const DisplayItemClient* layer_client = nullptr);
// Generate raster invalidations for a subset of the paint chunks in the // Generate raster invalidations for a subset of the paint chunks in the
// paint artifact. // paint artifact.
...@@ -45,7 +46,8 @@ class PLATFORM_EXPORT RasterInvalidator { ...@@ -45,7 +46,8 @@ class PLATFORM_EXPORT RasterInvalidator {
const PaintChunkSubset&, const PaintChunkSubset&,
const gfx::Rect& layer_bounds, const gfx::Rect& layer_bounds,
const PropertyTreeState& layer_state, const PropertyTreeState& layer_state,
const FloatSize& visual_rect_subpixel_offset = FloatSize()); const FloatSize& visual_rect_subpixel_offset = FloatSize(),
const DisplayItemClient* layer_client = nullptr);
bool Matches(const PaintChunk& paint_chunk) const { bool Matches(const PaintChunk& paint_chunk) const {
return paint_chunks_info_.size() && paint_chunks_info_[0].is_cacheable && return paint_chunks_info_.size() && paint_chunks_info_[0].is_cacheable &&
...@@ -56,6 +58,8 @@ class PLATFORM_EXPORT RasterInvalidator { ...@@ -56,6 +58,8 @@ class PLATFORM_EXPORT RasterInvalidator {
size_t ApproximateUnsharedMemoryUsage() const; size_t ApproximateUnsharedMemoryUsage() const;
void ClearOldStates();
private: private:
friend class RasterInvalidatorTest; friend class RasterInvalidatorTest;
...@@ -125,6 +129,8 @@ class PLATFORM_EXPORT RasterInvalidator { ...@@ -125,6 +129,8 @@ class PLATFORM_EXPORT RasterInvalidator {
r, Rect(0, 0, layer_bounds_.width(), layer_bounds_.height())); r, Rect(0, 0, layer_bounds_.width(), layer_bounds_.height()));
} }
void TrackImplicitFullLayerInvalidation(const DisplayItemClient&);
RasterInvalidationFunction raster_invalidation_function_; RasterInvalidationFunction raster_invalidation_function_;
gfx::Rect layer_bounds_; gfx::Rect layer_bounds_;
Vector<PaintChunkInfo> paint_chunks_info_; Vector<PaintChunkInfo> paint_chunks_info_;
......
...@@ -62,6 +62,8 @@ const char* PaintInvalidationReasonToString(PaintInvalidationReason reason) { ...@@ -62,6 +62,8 @@ const char* PaintInvalidationReasonToString(PaintInvalidationReason reason) {
return "chunk reordered"; return "chunk reordered";
case PaintInvalidationReason::kPaintProperty: case PaintInvalidationReason::kPaintProperty:
return "paint property change"; return "paint property change";
case PaintInvalidationReason::kFullLayer:
return "full layer";
case PaintInvalidationReason::kForTesting: case PaintInvalidationReason::kForTesting:
return "for testing"; return "for testing";
case PaintInvalidationReason::kDelayedFull: case PaintInvalidationReason::kDelayedFull:
......
...@@ -40,6 +40,9 @@ enum class PaintInvalidationReason : unsigned { ...@@ -40,6 +40,9 @@ enum class PaintInvalidationReason : unsigned {
kChunkUncacheable, kChunkUncacheable,
kChunkReordered, kChunkReordered,
kPaintProperty, kPaintProperty,
// For tracking of direct raster invalidation of full composited layers. The
// invalidation may be implicit, e.g. when a layer is created.
kFullLayer,
kForTesting, kForTesting,
// kDelayedFull means that kFull is needed in order to fully paint the // kDelayedFull means that kFull is needed in order to fully paint the
// content, but that painting of the object can be delayed until a future // content, but that painting of the object can be delayed until a future
......
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