Commit 369a8a8f authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[SPv175+] paint_dirty_rect mapping

Extend PaintLayerPainter::AdjustForPaintOffsetTranslation() which
adjusted paint_dirty_rect based on PaintOffsetTranslation to
AdjustForPaintProperties() which (if needed) maps paint_dirty_rect
from the root layer to the current layer dealing with more cases:
- The existing PaintOffsetTranslation handling;
- Fixed layer whose transform state may escape the root layer's
  transform state;
- Scroll offsets.

This fixes most of the failures of spv175+rls.

Bug: 793675
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I400c9da7d215132247c1b4e631be692070fdb655
Reviewed-on: https://chromium-review.googlesource.com/827671
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524458}
parent edb75db2
...@@ -290,7 +290,6 @@ Bug(none) compositing/overflow/content-loses-scrollbars.html [ Failure ] ...@@ -290,7 +290,6 @@ Bug(none) compositing/overflow/content-loses-scrollbars.html [ Failure ]
Bug(none) compositing/overflow/content-gains-scrollbars.html [ Failure ] Bug(none) compositing/overflow/content-gains-scrollbars.html [ Failure ]
Bug(none) compositing/overflow/mask-with-filter.html [ Failure Crash ] Bug(none) compositing/overflow/mask-with-filter.html [ Failure Crash ]
Bug(none) compositing/overflow/mask-with-small-content-rect.html [ Failure ] Bug(none) compositing/overflow/mask-with-small-content-rect.html [ Failure ]
Bug(none) compositing/overflow/nested-render-surfaces-with-intervening-clip.html [ Failure Crash ]
Bug(none) compositing/overflow/nested-render-surfaces-with-rotation.html [ Failure ] Bug(none) compositing/overflow/nested-render-surfaces-with-rotation.html [ Failure ]
Bug(none) compositing/overflow/nested-render-surfaces.html [ Failure Crash ] Bug(none) compositing/overflow/nested-render-surfaces.html [ Failure Crash ]
Bug(none) compositing/overflow/nested-scrolling.html [ Failure ] Bug(none) compositing/overflow/nested-scrolling.html [ Failure ]
...@@ -338,7 +337,6 @@ Bug(none) compositing/reflections/nested-reflection-transformed2.html [ Failure ...@@ -338,7 +337,6 @@ Bug(none) compositing/reflections/nested-reflection-transformed2.html [ Failure
Bug(none) compositing/reflections/nested-reflection-transition.html [ Failure Crash ] Bug(none) compositing/reflections/nested-reflection-transition.html [ Failure Crash ]
Bug(none) compositing/reflections/nested-reflection.html [ Failure Crash ] Bug(none) compositing/reflections/nested-reflection.html [ Failure Crash ]
Bug(none) compositing/reflections/reflection-in-composited.html [ Failure Crash ] Bug(none) compositing/reflections/reflection-in-composited.html [ Failure Crash ]
Bug(none) compositing/reflections/simple-composited-reflections.html [ Failure Crash ]
Bug(none) compositing/reflections/transform-inside-reflection.html [ Failure Crash ] Bug(none) compositing/reflections/transform-inside-reflection.html [ Failure Crash ]
Bug(none) compositing/rtl/rtl-absolute-overflow-scrolled.html [ Failure Crash ] Bug(none) compositing/rtl/rtl-absolute-overflow-scrolled.html [ Failure Crash ]
Bug(none) compositing/rtl/rtl-absolute-overflow.html [ Failure Crash ] Bug(none) compositing/rtl/rtl-absolute-overflow.html [ Failure Crash ]
...@@ -827,7 +825,6 @@ Bug(none) fast/text/word-break.html [ Failure ] ...@@ -827,7 +825,6 @@ Bug(none) fast/text/word-break.html [ Failure ]
Bug(none) fast/writing-mode/fieldsets.html [ Failure ] Bug(none) fast/writing-mode/fieldsets.html [ Failure ]
Bug(none) images/cross-fade-invalidation.html [ Crash Failure Pass ] Bug(none) images/cross-fade-invalidation.html [ Crash Failure Pass ]
Bug(none) paint/pagination/pagination-change-clip-crash.html [ Failure ] Bug(none) paint/pagination/pagination-change-clip-crash.html [ Failure ]
Bug(none) paint/selection/text-selection-newline-mixed-ltr-rtl.html [ Failure ]
Bug(none) fast/multicol/input-with-overflow-second-column.html [ Failure ] Bug(none) fast/multicol/input-with-overflow-second-column.html [ Failure ]
...@@ -1182,10 +1179,7 @@ Bug(none) compositing/geometry/transformed-abs-position-inside-composited.html [ ...@@ -1182,10 +1179,7 @@ Bug(none) compositing/geometry/transformed-abs-position-inside-composited.html [
Bug(none) fast/table/border-collapsing/001-vertical.html [ Failure ] Bug(none) fast/table/border-collapsing/001-vertical.html [ Failure ]
Bug(none) fast/table/border-collapsing/001.html [ Failure ] Bug(none) fast/table/border-collapsing/001.html [ Failure ]
# crashes due to unexpected calls to GeometryMapper (inverted scroll clip) crbug.com/768102 fast/pagination/multicol.html [ Crash ]
crbug.com/768102 compositing/overflow/reflected-overlay-scrollbars-should-appear-without-compositing.html [ Crash ]
crbug.com/768102 compositing/overflow/reflected-overlay-scrollbars-should-respect-ancestor-clip.html [ Crash ]
crbug.com/768102 compositing/overflow/reparented-overlay-scrollbars-should-respect-ancestor-clip.html [ Crash ]
crbug.com/644358 paint/invalidation/selection/selection-after-delete.html [ Failure ] crbug.com/644358 paint/invalidation/selection/selection-after-delete.html [ Failure ]
crbug.com/644358 paint/invalidation/selection/selection-after-remove.html [ Failure ] crbug.com/644358 paint/invalidation/selection/selection-after-remove.html [ Failure ]
...@@ -1423,7 +1417,6 @@ Bug(700530) compositing/overflow/paint-neg-z-order-descendants-into-scrolling-co ...@@ -1423,7 +1417,6 @@ Bug(700530) compositing/overflow/paint-neg-z-order-descendants-into-scrolling-co
Bug(700530) fast/multicol/tall-content-in-inner-with-fixed-height.html [ Failure ] Bug(700530) fast/multicol/tall-content-in-inner-with-fixed-height.html [ Failure ]
# The following debug crashes / failures have not been triaged. # The following debug crashes / failures have not been triaged.
crbug.com/702805 virtual/threaded/compositing/visibility/overlays-persist-on-navigation.html [ Crash Failure ]
crbug.com/702805 fast/forms/select-popup/popup-menu-appearance-coarse.html [ Crash Timeout Failure ] crbug.com/702805 fast/forms/select-popup/popup-menu-appearance-coarse.html [ Crash Timeout Failure ]
crbug.com/702805 compositing/visibility/overlays-persist-on-navigation.html [ Crash Failure ] crbug.com/702805 compositing/visibility/overlays-persist-on-navigation.html [ Crash Failure ]
...@@ -1479,7 +1472,6 @@ Bug(none) fast/forms/validation-bubble-appearance-edge.html [ Failure ] ...@@ -1479,7 +1472,6 @@ Bug(none) fast/forms/validation-bubble-appearance-edge.html [ Failure ]
Bug(none) fast/forms/validation-bubble-appearance-iframe.html [ Failure ] Bug(none) fast/forms/validation-bubble-appearance-iframe.html [ Failure ]
Bug(none) fast/forms/validation-bubble-appearance-rtl-ui.html [ Failure ] Bug(none) fast/forms/validation-bubble-appearance-rtl-ui.html [ Failure ]
Bug(none) fast/overflow/overflow-with-local-background-attachment.html [ Failure ] Bug(none) fast/overflow/overflow-with-local-background-attachment.html [ Failure ]
Bug(none) paint/filters/clip-under-filter.html [ Failure ]
Bug(none) svg/text/text-selection-text-06-t.svg [ Failure ] Bug(none) svg/text/text-selection-text-06-t.svg [ Failure ]
Bug(none) svg/transforms/transformed-text-fill-pattern.html [ Failure ] Bug(none) svg/transforms/transformed-text-fill-pattern.html [ Failure ]
...@@ -1740,3 +1732,5 @@ Bug(none) css3/blending/mix-blend-mode-simple.html [ Pass Timeout ] ...@@ -1740,3 +1732,5 @@ Bug(none) css3/blending/mix-blend-mode-simple.html [ Pass Timeout ]
Bug(none) css3/blending/mix-blend-mode-simple-text.html [ Pass Timeout ] Bug(none) css3/blending/mix-blend-mode-simple-text.html [ Pass Timeout ]
crbug.com/708175 virtual/mojo-blobs/external/wpt/IndexedDB/interleaved-cursors.html [ Timeout ] crbug.com/708175 virtual/mojo-blobs/external/wpt/IndexedDB/interleaved-cursors.html [ Timeout ]
crbug.com/529963 paint/invalidation/background/background-attachment-fixed-scrolled.html [ Failure ]
...@@ -77,19 +77,13 @@ crbug.com/769942 virtual/spv175/paint/invalidation/svg/js-late-clipPath-creation ...@@ -77,19 +77,13 @@ crbug.com/769942 virtual/spv175/paint/invalidation/svg/js-late-clipPath-creation
crbug.com/771643 virtual/spv175/compositing/overflow/nested-border-radius-clipping.html [ Failure ] crbug.com/771643 virtual/spv175/compositing/overflow/nested-border-radius-clipping.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/squashing/squash-overflow-hidden-scrolltop.html [ Failure ] crbug.com/771643 virtual/spv175/compositing/squashing/squash-overflow-hidden-scrolltop.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/squashing/squash-with-ancestor-reflection.html [ Failure ]
crbug.com/771643 virtual/spv175/compositing/visibility/visibility-image-layers.html [ Failure Pass ] crbug.com/771643 virtual/spv175/compositing/visibility/visibility-image-layers.html [ Failure Pass ]
crbug.com/771643 virtual/spv175/paint/invalidation/offset-change-wrong-invalidation-with-float.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/compositing/resize-squashing-layer-that-needs-full-repaint.html [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/compositing/resize-squashing-layer-that-needs-full-repaint.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/compositing/subpixel-offset-scaled-transform-composited.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/forms/select-option-background-color.html [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/forms/select-option-background-color.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/multicol/multicol-with-overflowing-block-rl.html [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/multicol/multicol-with-overflowing-block-rl.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/overflow/paged-with-overflowing-block-rl.html [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/overflow/paged-with-overflowing-block-rl.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/position/position-change-keeping-geometry.html [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/position/position-change-keeping-geometry.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/reflection/reflection-repaint-test.html [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/reflection/reflection-repaint-test.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/scroll/repaint-during-scroll-with-zoom.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/scroll/resize-scrollable-iframe.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/scroll/scroll-descendant-with-cached-cliprects.html [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/absolute-sized-content-with-resources.xhtml [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/svg/absolute-sized-content-with-resources.xhtml [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/deep-dynamic-updates.svg [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/svg/deep-dynamic-updates.svg [ Failure ]
crbug.com/771643 virtual/spv175/paint/invalidation/svg/filter-refresh.svg [ Failure ] crbug.com/771643 virtual/spv175/paint/invalidation/svg/filter-refresh.svg [ Failure ]
...@@ -103,26 +97,7 @@ crbug.com/771643 virtual/spv175/paint/pagination/pagination-change-clip-crash.ht ...@@ -103,26 +97,7 @@ crbug.com/771643 virtual/spv175/paint/pagination/pagination-change-clip-crash.ht
# spv175+root-layer-scrolls failures # spv175+root-layer-scrolls failures
crbug.com/793675 virtual/spv175/compositing/iframes/iframe-composited-scrolling.html [ Failure Pass ] crbug.com/793675 virtual/spv175/compositing/iframes/iframe-composited-scrolling.html [ Failure Pass ]
crbug.com/793675 virtual/spv175/compositing/gestures/gesture-tapHighlight-1-iframe-composited-scrolled-late-noncomposite.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/gestures/gesture-tapHighlight-1-iframe-scrolled.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/gestures/gesture-tapHighlight-1-iframe.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-inner.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/gestures/gesture-tapHighlight-2-iframe.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/iframes/fixed-position-iframe.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/iframes/iframe-copy-on-scroll.html [ Failure ]
crbug.com/793675 virtual/spv175/compositing/overflow/border-radius-composited-subframe.html [ Failure ] crbug.com/793675 virtual/spv175/compositing/overflow/border-radius-composited-subframe.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/frames/frameset-with-stacking-context-and-not-stacking-context-children.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/repaint-in-iframe.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/compositing/become-composited-zero-offset.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/compositing/iframe-inside-squashed-layer.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/position/invalidate-paint-for-fixed-pos-inside-iframe.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/scroll/nested-fixed-iframe-scrolled.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/scroll/nested-iframe-scroll-inner.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/scroll/nested-iframe-scroll-outer.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/selection/selection-change-in-iframe-with-relative-parent.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/svg/scrolling-embedded-svg-file-image-repaint-problem.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/table/scroll-relative-table-inside-table-cell.html [ Failure ]
crbug.com/793675 virtual/spv175/paint/invalidation/window-resize/window-resize-vertical-writing-mode.html [ Crash ] crbug.com/793675 virtual/spv175/paint/invalidation/window-resize/window-resize-vertical-writing-mode.html [ Crash ]
########## Ref tests can't be rebaselined ########## ########## Ref tests can't be rebaselined ##########
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [250, 230, 100, 100], "rect": [250, 230, 100, 100],
"reason": "disappeared" "reason": "paint property change"
}, },
{ {
"object": "LayoutBlockFlow (relative positioned) DIV class='relative reflected'", "object": "LayoutBlockFlow (relative positioned) DIV class='relative reflected'",
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
}, },
{ {
"name": "LayoutBlockFlow (positioned) DIV class='absolute green reflected'", "name": "LayoutBlockFlow (positioned) DIV class='absolute green reflected'",
"position": [150, 150], "bounds": [250, 250],
"bounds": [100, 100],
"backgroundColor": "#008000", "backgroundColor": "#008000",
"transform": 3 "transform": 3
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [100, 150, 100, 100], "rect": [100, 150, 100, 100],
"reason": "disappeared" "reason": "paint property change"
}, },
{ {
"object": "LayoutBlockFlow (relative positioned) DIV class='relative green'", "object": "LayoutBlockFlow (relative positioned) DIV class='relative green'",
......
...@@ -11,10 +11,15 @@ ...@@ -11,10 +11,15 @@
"rect": [79, 129, 142, 142], "rect": [79, 129, 142, 142],
"reason": "appeared" "reason": "appeared"
}, },
{
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [114, 129, 107, 36],
"reason": "paint property change"
},
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [100, 150, 100, 100], "rect": [100, 150, 100, 100],
"reason": "disappeared" "reason": "paint property change"
} }
] ]
} }
......
...@@ -14,7 +14,12 @@ ...@@ -14,7 +14,12 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [79, 129, 142, 142], "rect": [79, 129, 142, 142],
"reason": "disappeared" "reason": "paint property change"
},
{
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [114, 129, 107, 36],
"reason": "paint property change"
} }
] ]
} }
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http:/html4/strict.dtd"> "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en"> <html lang="en">
<head> <head>
<script src="../resources/text-based-repaint.js" type="text/javascript" charset="utf-8"></script> <script src="../resources/text-based-repaint.js" type="text/javascript" charset="utf-8"></script>
......
layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x52
LayoutBlockFlow {HTML} at (0,0) size 800x52
LayoutBlockFlow {BODY} at (8,16) size 784x20
LayoutBlockFlow {P} at (0,0) size 784x20
LayoutText {#text} at (0,0) size 375x19
text run at (0,0) width 375: "In pixel results, the blue box should be scrolled out of view."
layer at (8,52) size 0x0
LayoutBlockFlow (positioned) {DIV} at (8,52) size 0x0
layer at (8,52) size 324x229
LayoutBlockFlow (positioned) zI: 1 {DIV} at (8,52) size 324x229
LayoutText zI: 1 {#text} at (0,0) size 0x0
layer at (18,62) size 304x204
LayoutIFrame {IFRAME} at (10,10) size 304x204 [border: (2px inset #EEEEEE)]
layer at (0,0) size 300x200 clip at (0,0) size 285x200 scrollY 120.00 scrollHeight 1018
LayoutView at (0,0) size 300x200
layer at (0,-120) size 285x1018 backgroundClip at (0,0) size 285x200 clip at (0,0) size 285x200
LayoutBlockFlow {HTML} at (0,0) size 285x1018
LayoutBlockFlow {BODY} at (8,10) size 269x1000 [bgcolor=#C0C0C0]
LayoutBlockFlow {DIV} at (10,0) size 110x110 [bgcolor=#0000FF]
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
"layers": [ "layers": [
{ {
"name": "LayoutView #document", "name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [785, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [785, 1016], "bounds": [785, 1016],
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#FFFFFF" "backgroundColor": "#FFFFFF"
...@@ -53,6 +63,10 @@ ...@@ -53,6 +63,10 @@
} }
], ],
"objectPaintInvalidations": [ "objectPaintInvalidations": [
{
"object": "LayoutView #document",
"reason": "style change"
},
{ {
"object": "LayoutView #document", "object": "LayoutView #document",
"reason": "geometry" "reason": "geometry"
...@@ -61,10 +75,6 @@ ...@@ -61,10 +75,6 @@
"object": "VerticalScrollbar", "object": "VerticalScrollbar",
"reason": "scroll control" "reason": "scroll control"
}, },
{
"object": "LayoutView #document",
"reason": "style change"
},
{ {
"object": "LayoutBlockFlow BODY", "object": "LayoutBlockFlow BODY",
"reason": "geometry" "reason": "geometry"
......
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF"
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='container1' class='container scale'",
"contentsOpaque": true,
"drawsContent": false,
"transform": 2
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='child1' class='child composited'",
"bounds": [1, 1],
"contentsOpaque": true,
"backgroundColor": "#0000FF",
"transform": 2
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='child2' class='child scale composited'",
"bounds": [1, 1],
"contentsOpaque": true,
"backgroundColor": "#0000FF",
"transform": 4
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='container3' class='container scale composited'",
"bounds": [1, 1],
"contentsOpaque": true,
"transform": 6
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='container4' class='container composited'",
"position": [9, 158],
"bounds": [40, 40],
"paintInvalidations": [
{
"object": "LayoutBlockFlow (relative positioned) DIV id='child4' class='child scale'",
"rect": [0, 0, 40, 40],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV id='container4' class='container composited'",
"rect": [0, 0, 40, 40],
"reason": "full"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV id='container4' class='container composited'",
"rect": [0, 0, 40, 40],
"reason": "full"
}
]
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='container5' class='container scale composited'",
"contentsOpaque": true,
"drawsContent": false,
"transform": 8
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='child5' class='child composited'",
"bounds": [1, 1],
"contentsOpaque": true,
"backgroundColor": "#0000FF",
"transform": 8
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='container6' class='container composited'",
"position": [8, 258],
"contentsOpaque": true,
"drawsContent": false
},
{
"name": "LayoutBlockFlow (relative positioned) DIV id='child6' class='child scale composited'",
"bounds": [1, 1],
"contentsOpaque": true,
"backgroundColor": "#0000FF",
"transform": 10
}
],
"transforms": [
{
"id": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[8, 8, 0, 1]
]
},
{
"id": 2,
"parent": 1,
"transform": [
[40, 0, 0, 0],
[0, 40, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
],
"origin": [0, 0]
},
{
"id": 3,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[9, 58, 0, 1]
]
},
{
"id": 4,
"parent": 3,
"transform": [
[40, 0, 0, 0],
[0, 40, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
],
"origin": [0, 0]
},
{
"id": 5,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[8, 108, 0, 1]
]
},
{
"id": 6,
"parent": 5,
"transform": [
[40, 0, 0, 0],
[0, 40, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
],
"origin": [0, 0]
},
{
"id": 7,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[8, 208, 0, 1]
]
},
{
"id": 8,
"parent": 7,
"transform": [
[40, 0, 0, 0],
[0, 40, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
],
"origin": [0, 0]
},
{
"id": 9,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[9, 258, 0, 1]
]
},
{
"id": 10,
"parent": 9,
"transform": [
[40, 0, 0, 0],
[0, 40, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
],
"origin": [0, 0]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow (relative positioned) DIV id='container2' class='container'",
"reason": "geometry"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV id='container4' class='container composited'",
"reason": "geometry"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV id='container6' class='container composited'",
"reason": "geometry"
}
]
}
...@@ -186,76 +186,6 @@ ...@@ -186,76 +186,6 @@
"rect": [8, 61, 48, 185], "rect": [8, 61, 48, 185],
"reason": "style change" "reason": "style change"
}, },
{
"object": "InlineTextBox '\n'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox '\n'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox '\n'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox '\n'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox '\n'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox '\n'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox '\n'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{
"object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185],
"reason": "style change"
},
{ {
"object": "InlineTextBox ' Text'", "object": "InlineTextBox ' Text'",
"rect": [8, 61, 48, 185], "rect": [8, 61, 48, 185],
......
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
{ {
"name": "LayoutView #document", "name": "LayoutView #document",
"bounds": [800, 600], "bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
...@@ -12,7 +22,7 @@ ...@@ -12,7 +22,7 @@
"reason": "disappeared" "reason": "disappeared"
}, },
{ {
"object": "LayoutListMarker (anonymous)", "object": "LayoutBlockFlow (positioned) UL id='submenu'",
"rect": [70, 94, 7, 19], "rect": [70, 94, 7, 19],
"reason": "disappeared" "reason": "disappeared"
} }
...@@ -32,7 +42,14 @@ ...@@ -32,7 +42,14 @@
{ {
"name": "LayoutListItem (relative positioned) (floating) LI id='menu'", "name": "LayoutListItem (relative positioned) (floating) LI id='menu'",
"position": [30, 44], "position": [30, 44],
"bounds": [18, 19] "bounds": [18, 19],
"paintInvalidations": [
{
"object": "LayoutListMarker (anonymous)",
"rect": [0, 0, 7, 19],
"reason": "geometry"
}
]
} }
], ],
"objectPaintInvalidations": [ "objectPaintInvalidations": [
......
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutBlockFlow (positioned) DIV",
"rect": [18, 418, 50, 50],
"reason": "style change"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow (positioned) DIV",
"reason": "style change"
}
]
}
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
{ {
"name": "LayoutView #document", "name": "LayoutView #document",
"bounds": [800, 600], "bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
......
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV",
"rect": [18, 418, 50, 50],
"reason": "style change"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow DIV",
"reason": "style change"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [785, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [785, 2016],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='div'",
"rect": [22, 522, 100, 100],
"reason": "style change"
}
],
"transform": 1
}
],
"transforms": [
{
"id": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, -400, 0, 1]
],
"flattenInheritedTransform": false
}
],
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='div'",
"reason": "style change"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#C0C0C0"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#C0C0C0",
"paintInvalidations": [
{
"object": "LayoutView #document",
"rect": [3, 65, 250, 250],
"reason": "subtree"
},
{
"object": "LayoutBlockFlow HTML",
"rect": [3, 65, 235, 235],
"reason": "paint property change"
},
{
"object": "HorizontalScrollbar",
"rect": [3, 300, 235, 15],
"reason": "scroll control"
},
{
"object": "LayoutBlockFlow HTML",
"rect": [3, 65, 55, 17],
"reason": "appeared"
},
{
"object": "VerticalScrollbar",
"rect": [238, 65, 15, 235],
"reason": "scroll control"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutView #document",
"reason": "subtree"
},
{
"object": "HorizontalScrollbar",
"reason": "scroll control"
},
{
"object": "VerticalScrollbar",
"reason": "scroll control"
},
{
"object": "LayoutBlockFlow HTML",
"reason": "subtree"
},
{
"object": "LayoutBlockFlow BODY",
"reason": "subtree"
},
{
"object": "RootInlineBox",
"reason": "subtree"
},
{
"object": "LayoutText #text",
"reason": "subtree"
},
{
"object": "InlineTextBox 'scroll me'",
"reason": "subtree"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutView #document",
"rect": [8, 108, 300, 300],
"reason": "geometry"
},
{
"object": "HorizontalScrollbar",
"rect": [8, 393, 285, 15],
"reason": "scroll control"
},
{
"object": "HorizontalScrollbar",
"rect": [8, 193, 85, 15],
"reason": "scroll control"
},
{
"object": "VerticalScrollbar",
"rect": [293, 108, 15, 285],
"reason": "scroll control"
},
{
"object": "VerticalScrollbar",
"rect": [93, 108, 15, 85],
"reason": "scroll control"
}
]
}
],
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow (anonymous)",
"reason": "geometry"
},
{
"object": "RootInlineBox",
"reason": "geometry"
},
{
"object": "LayoutIFrame IFRAME id='iframe'",
"reason": "geometry"
},
{
"object": "LayoutView #document",
"reason": "incremental"
},
{
"object": "LayoutView #document",
"reason": "geometry"
},
{
"object": "HorizontalScrollbar",
"reason": "scroll control"
},
{
"object": "LayoutView #document",
"reason": "geometry"
},
{
"object": "VerticalScrollbar",
"reason": "scroll control"
}
]
}
{
"layers": [
{
"name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [785, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [785, 1895],
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutBlockFlow (relative positioned) DIV id='ul'",
"rect": [677, 252, 100, 100],
"reason": "paint property change"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV id='ul'",
"rect": [677, 52, 100, 100],
"reason": "paint property change"
}
],
"transform": 1
}
],
"transforms": [
{
"id": 1,
"transform": [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, -200, 0, 1]
],
"flattenInheritedTransform": false
}
],
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow (positioned) DIV id='scrollpanel'",
"reason": "style change"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV class='container'",
"reason": "style change"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV id='ul'",
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV",
"reason": "style change"
},
{
"object": "LayoutBlockFlow (positioned) DIV id='scrollpanel'",
"reason": "style change"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV class='container'",
"reason": "style change"
},
{
"object": "LayoutBlockFlow (relative positioned) DIV id='ul'",
"reason": "style change"
},
{
"object": "LayoutBlockFlow DIV",
"reason": "style change"
}
]
}
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [93, 234, 142, 143], "rect": [93, 234, 142, 143],
"reason": "disappeared" "reason": "paint property change"
} }
], ],
"transform": 1 "transform": 1
......
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
"object": "LayoutBlockFlow (positioned) DIV class='absolute green'", "object": "LayoutBlockFlow (positioned) DIV class='absolute green'",
"rect": [100, 1150, 100, 100], "rect": [100, 1150, 100, 100],
"reason": "appeared" "reason": "appeared"
},
{
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [100, 1150, 100, 100],
"reason": "paint property change"
} }
], ],
"transform": 1 "transform": 1
......
...@@ -21,10 +21,15 @@ ...@@ -21,10 +21,15 @@
"rect": [79, 129, 142, 142], "rect": [79, 129, 142, 142],
"reason": "appeared" "reason": "appeared"
}, },
{
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [114, 129, 107, 36],
"reason": "paint property change"
},
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [100, 150, 100, 100], "rect": [100, 150, 100, 100],
"reason": "disappeared" "reason": "paint property change"
} }
] ]
} }
......
...@@ -24,7 +24,12 @@ ...@@ -24,7 +24,12 @@
{ {
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'", "object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [79, 129, 142, 142], "rect": [79, 129, 142, 142],
"reason": "disappeared" "reason": "paint property change"
},
{
"object": "LayoutBlockFlow (positioned) DIV class='absolute red'",
"rect": [114, 129, 107, 36],
"reason": "paint property change"
} }
] ]
} }
......
...@@ -3,6 +3,16 @@ ...@@ -3,6 +3,16 @@
{ {
"name": "LayoutView #document", "name": "LayoutView #document",
"bounds": [800, 600], "bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [800, 600],
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
"paintInvalidations": [ "paintInvalidations": [
......
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
"layers": [ "layers": [
{ {
"name": "LayoutView #document", "name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [785, 585],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [1026, 1036], "bounds": [1026, 1036],
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
...@@ -73,7 +83,8 @@ ...@@ -73,7 +83,8 @@
[0, 1, 0, 0], [0, 1, 0, 0],
[0, 0, 1, 0], [0, 0, 1, 0],
[0, -451, 0, 1] [0, -451, 0, 1]
] ],
"flattenInheritedTransform": false
} }
], ],
"objectPaintInvalidations": [ "objectPaintInvalidations": [
......
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
"layers": [ "layers": [
{ {
"name": "LayoutView #document", "name": "LayoutView #document",
"bounds": [800, 600],
"backgroundColor": "#FFFFFF"
},
{
"name": "Scrolling Layer",
"bounds": [800, 600],
"drawsContent": false
},
{
"name": "Scrolling Contents Layer",
"bounds": [1566, 1781], "bounds": [1566, 1781],
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#FFFFFF", "backgroundColor": "#FFFFFF",
...@@ -19,7 +29,7 @@ ...@@ -19,7 +29,7 @@
{ {
"object": "LayoutBlockFlow (relative positioned) DIV class='relative red'", "object": "LayoutBlockFlow (relative positioned) DIV class='relative red'",
"rect": [1114, 1314, 435, 450], "rect": [1114, 1314, 435, 450],
"reason": "disappeared" "reason": "paint property change"
}, },
{ {
"object": "HorizontalScrollbar", "object": "HorizontalScrollbar",
...@@ -38,7 +48,8 @@ ...@@ -38,7 +48,8 @@
[0, 1, 0, 0], [0, 1, 0, 0],
[0, 0, 1, 0], [0, 0, 1, 0],
[-766, -1181, 0, 1] [-766, -1181, 0, 1]
] ],
"flattenInheritedTransform": false
} }
], ],
"objectPaintInvalidations": [ "objectPaintInvalidations": [
......
...@@ -275,9 +275,14 @@ void BlockPainter::PaintObject(const PaintInfo& paint_info, ...@@ -275,9 +275,14 @@ void BlockPainter::PaintObject(const PaintInfo& paint_info,
paint_info.context.GetPaintController(), scroll_translation, paint_info.context.GetPaintController(), scroll_translation,
layout_block_, DisplayItem::PaintPhaseToDrawingType(paint_phase)); layout_block_, DisplayItem::PaintPhaseToDrawingType(paint_phase));
scrolled_paint_info.emplace(paint_info); scrolled_paint_info.emplace(paint_info);
scrolled_paint_info->UpdateCullRectForScrollingContents( if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
EnclosingIntRect(layout_block_.OverflowClipRect(paint_offset)), scrolled_paint_info->UpdateCullRectForScrollingContents(
scroll_translation->Matrix().ToAffineTransform()); EnclosingIntRect(layout_block_.OverflowClipRect(paint_offset)),
scroll_translation->Matrix().ToAffineTransform());
} else {
scrolled_paint_info->UpdateCullRect(
scroll_translation->Matrix().ToAffineTransform());
}
} }
} else if (layout_block_.HasOverflowClip()) { } else if (layout_block_.HasOverflowClip()) {
IntSize scroll_offset = layout_block_.ScrolledContentOffset(); IntSize scroll_offset = layout_block_.ScrolledContentOffset();
......
...@@ -43,7 +43,7 @@ void FramePainter::Paint(GraphicsContext& context, ...@@ -43,7 +43,7 @@ void FramePainter::Paint(GraphicsContext& context,
GetFrameView().Location(), GetFrameView().VisibleContentRect().Size()); GetFrameView().Location(), GetFrameView().VisibleContentRect().Size());
IntPoint content_offset = IntPoint content_offset =
-GetFrameView().Location() + GetFrameView().ScrollOffsetInt(); -GetFrameView().Location() + GetFrameView().ScrollOffsetInt();
if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled() && if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() &&
!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { !RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
auto content_cull_rect = rect; auto content_cull_rect = rect;
content_cull_rect.UpdateForScrollingContents( content_cull_rect.UpdateForScrollingContents(
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "platform/graphics/paint/CompositingRecorder.h" #include "platform/graphics/paint/CompositingRecorder.h"
#include "platform/graphics/paint/DisplayItemCacheSkipper.h" #include "platform/graphics/paint/DisplayItemCacheSkipper.h"
#include "platform/graphics/paint/DrawingRecorder.h" #include "platform/graphics/paint/DrawingRecorder.h"
#include "platform/graphics/paint/GeometryMapper.h"
#include "platform/graphics/paint/PaintChunkProperties.h" #include "platform/graphics/paint/PaintChunkProperties.h"
#include "platform/graphics/paint/ScopedPaintChunkProperties.h" #include "platform/graphics/paint/ScopedPaintChunkProperties.h"
#include "platform/graphics/paint/SubsequenceRecorder.h" #include "platform/graphics/paint/SubsequenceRecorder.h"
...@@ -241,6 +242,7 @@ static bool ShouldRepaintSubsequence( ...@@ -241,6 +242,7 @@ static bool ShouldRepaintSubsequence(
} }
paint_layer.SetPreviousPaintDirtyRect(painting_info.paint_dirty_rect); paint_layer.SetPreviousPaintDirtyRect(painting_info.paint_dirty_rect);
// TODO(wangxianzhu): Get rid of scroll_offset_accumulation for SPv175.
// Repaint if scroll offset accumulation changes. // Repaint if scroll offset accumulation changes.
if (painting_info.scroll_offset_accumulation != if (painting_info.scroll_offset_accumulation !=
paint_layer.PreviousScrollOffsetAccumulationForPainting()) { paint_layer.PreviousScrollOffsetAccumulationForPainting()) {
...@@ -253,47 +255,67 @@ static bool ShouldRepaintSubsequence( ...@@ -253,47 +255,67 @@ static bool ShouldRepaintSubsequence(
return needs_repaint; return needs_repaint;
} }
void PaintLayerPainter::AdjustForPaintOffsetTranslation( void PaintLayerPainter::AdjustForPaintProperties(
PaintLayerPaintingInfo& painting_info) { PaintLayerPaintingInfo& painting_info,
PaintLayerFlags& paint_flags) {
if (!RuntimeEnabledFeatures::SlimmingPaintV175Enabled()) if (!RuntimeEnabledFeatures::SlimmingPaintV175Enabled())
return; return;
// Paint offset translation for transforms or composited layers is already // Paint properties for transforms, composited layers or LayoutView is already
// taken care of. // taken care of.
if (paint_layer_.PaintsWithTransform(painting_info.GetGlobalPaintFlags()) || if (&paint_layer_ == painting_info.root_layer ||
paint_layer_.PaintsWithTransform(painting_info.GetGlobalPaintFlags()) ||
paint_layer_.PaintsIntoOwnOrGroupedBacking( paint_layer_.PaintsIntoOwnOrGroupedBacking(
painting_info.GetGlobalPaintFlags())) painting_info.GetGlobalPaintFlags()) ||
paint_layer_.GetLayoutObject().IsLayoutView())
return; return;
if (const auto* properties = const auto& current_fragment = paint_layer_.GetLayoutObject().FirstFragment();
paint_layer_.GetLayoutObject().FirstFragment().PaintProperties()) { const auto* current_transform =
if (properties->PaintOffsetTranslation()) { current_fragment.LocalBorderBoxProperties()->Transform();
// Map paint_dirty_rect from the original root layer to the current layer, const auto& root_fragment =
// and make the current layer the new root layer. painting_info.root_layer->GetLayoutObject().FirstFragment();
painting_info.paint_dirty_rect = const auto* root_transform =
properties->PaintOffsetTranslation()->Matrix().Inverse().MapRect( root_fragment.LocalBorderBoxProperties()->Transform();
painting_info.paint_dirty_rect); if (current_transform == root_transform)
// If the original root layer doesn't have PaintOffsetTranslation which return;
// means that paint_layer_'s PaintOffsetTranslation includes root layer's
// paint offset, then we need to add the root layer's paint offset. // painting_info.paint_dirty_rect is currently in |painting_info.root_layer|'s
const auto& root_fragment = // pixel-snapped border box space. We need to adjust it into |paint_layer_|'s
painting_info.root_layer->GetLayoutObject().FirstFragment(); // space. This handles the following cases:
if (!root_fragment.PaintProperties() || // - The current layer has PaintOffsetTranslation;
!root_fragment.PaintProperties()->PaintOffsetTranslation()) // - The current layer's transform state escapes the root layers contents
painting_info.paint_dirty_rect.MoveBy(root_fragment.PaintOffset()); // transform, e.g. a fixed-position layer;
painting_info.root_layer = &paint_layer_; // - Scroll offsets.
const auto& matrix = GeometryMapper::SourceToDestinationProjection(
// TODO(chrishtr): is this correct for fragmentation? root_transform, current_transform);
painting_info.sub_pixel_accumulation = ToLayoutSize( painting_info.paint_dirty_rect.MoveBy(
paint_layer_.GetLayoutObject().FirstFragment().PaintOffset()); RoundedIntPoint(root_fragment.PaintOffset()));
} painting_info.paint_dirty_rect =
matrix.MapRect(painting_info.paint_dirty_rect);
painting_info.paint_dirty_rect.MoveBy(
-RoundedIntPoint(current_fragment.PaintOffset()));
// Make the current layer the new root layer.
painting_info.root_layer = &paint_layer_;
// These flags no longer apply for the new root layer.
paint_flags &= ~kPaintLayerPaintingSkipRootBackground;
paint_flags &= ~kPaintLayerPaintingOverflowContents;
paint_flags &= ~kPaintLayerPaintingCompositingScrollingPhase;
// TODO(chrishtr): is this correct for fragmentation?
if (current_fragment.PaintProperties() &&
current_fragment.PaintProperties()->PaintOffsetTranslation()) {
painting_info.sub_pixel_accumulation =
ToLayoutSize(current_fragment.PaintOffset());
} }
} }
PaintResult PaintLayerPainter::PaintLayerContents( PaintResult PaintLayerPainter::PaintLayerContents(
GraphicsContext& context, GraphicsContext& context,
const PaintLayerPaintingInfo& painting_info_arg, const PaintLayerPaintingInfo& painting_info_arg,
PaintLayerFlags paint_flags, PaintLayerFlags paint_flags_arg,
FragmentPolicy fragment_policy) { FragmentPolicy fragment_policy) {
PaintLayerFlags paint_flags = paint_flags_arg;
PaintResult result = kFullyPainted; PaintResult result = kFullyPainted;
if (paint_layer_.GetLayoutObject().GetFrameView()->ShouldThrottleRendering()) if (paint_layer_.GetLayoutObject().GetFrameView()->ShouldThrottleRendering())
...@@ -363,7 +385,7 @@ PaintResult PaintLayerPainter::PaintLayerContents( ...@@ -363,7 +385,7 @@ PaintResult PaintLayerPainter::PaintLayerContents(
} }
PaintLayerPaintingInfo painting_info = painting_info_arg; PaintLayerPaintingInfo painting_info = painting_info_arg;
AdjustForPaintOffsetTranslation(painting_info); AdjustForPaintProperties(painting_info, paint_flags);
LayoutPoint offset_from_root; LayoutPoint offset_from_root;
paint_layer_.ConvertToLayerCoords(painting_info.root_layer, offset_from_root); paint_layer_.ConvertToLayerCoords(painting_info.root_layer, offset_from_root);
...@@ -893,17 +915,9 @@ PaintResult PaintLayerPainter::PaintChildren( ...@@ -893,17 +915,9 @@ PaintResult PaintLayerPainter::PaintChildren(
scroll_parents.push_back(parent_layer); scroll_parents.push_back(parent_layer);
} }
// Iterate in reverse order to get ancestor scrollers before descendnat for (const auto* scroller : scroll_parents) {
// ones, so that AdjustForPaintOffsetTranslation ends up with the correct
// final rootLayer.
for (auto scroller = scroll_parents.rbegin();
scroller != scroll_parents.rend(); ++scroller) {
if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled()) {
PaintLayerPainter(**scroller)
.AdjustForPaintOffsetTranslation(child_painting_info);
}
child_painting_info.scroll_offset_accumulation += child_painting_info.scroll_offset_accumulation +=
(*scroller)->GetLayoutBox()->ScrolledContentOffset(); scroller->GetLayoutBox()->ScrolledContentOffset();
} }
if (PaintLayerPainter(*child->Layer()) if (PaintLayerPainter(*child->Layer())
...@@ -1049,17 +1063,14 @@ void PaintLayerPainter::PaintFragmentWithPhase( ...@@ -1049,17 +1063,14 @@ void PaintLayerPainter::PaintFragmentWithPhase(
LayoutPoint paint_offset = -paint_layer_.LayoutBoxLocation(); LayoutPoint paint_offset = -paint_layer_.LayoutBoxLocation();
if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled()) { if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled()) {
paint_offset += fragment.fragment_data->PaintOffset(); paint_offset += fragment.fragment_data->PaintOffset();
new_cull_rect.Move(painting_info.scroll_offset_accumulation); // For SPv175+, we paint in the containing transform node's space. Now
if (!RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) { // |new_cull_rect| is in the pixel-snapped border box space of
// For SPv175, we paint in the containing transform node's space. Now // |painting_info.root_layer|. Adjust it to the correct space.
// |new_cull_rect| is in the pixel-snapped border box space of // |paint_offset| is already in the correct space.
// |painting_info.root_layer|. Adjust it to the correct space. new_cull_rect.MoveBy(
// |paint_offset| is already in the correct space. RoundedIntPoint(painting_info.root_layer->GetLayoutObject()
new_cull_rect.MoveBy( .FirstFragment()
RoundedIntPoint(painting_info.root_layer->GetLayoutObject() .PaintOffset()));
.FirstFragment()
.PaintOffset()));
}
} else { } else {
paint_offset += ToSize(fragment.layer_bounds.Location()); paint_offset += ToSize(fragment.layer_bounds.Location());
if (!painting_info.scroll_offset_accumulation.IsZero()) { if (!painting_info.scroll_offset_accumulation.IsZero()) {
......
...@@ -151,7 +151,7 @@ class CORE_EXPORT PaintLayerPainter { ...@@ -151,7 +151,7 @@ class CORE_EXPORT PaintLayerPainter {
// invisible and therefore can't impact painted output. // invisible and therefore can't impact painted output.
bool PaintedOutputInvisible(const PaintLayerPaintingInfo&); bool PaintedOutputInvisible(const PaintLayerPaintingInfo&);
void AdjustForPaintOffsetTranslation(PaintLayerPaintingInfo&); void AdjustForPaintProperties(PaintLayerPaintingInfo&, PaintLayerFlags&);
PaintLayer& paint_layer_; PaintLayer& paint_layer_;
}; };
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "platform/geometry/FloatRect.h" #include "platform/geometry/FloatRect.h"
#include "platform/geometry/LayoutRect.h" #include "platform/geometry/LayoutRect.h"
#include "platform/runtime_enabled_features.h"
namespace blink { namespace blink {
...@@ -49,12 +50,13 @@ void CullRect::UpdateCullRect( ...@@ -49,12 +50,13 @@ void CullRect::UpdateCullRect(
void CullRect::UpdateForScrollingContents( void CullRect::UpdateForScrollingContents(
const IntRect& overflow_clip_rect, const IntRect& overflow_clip_rect,
const AffineTransform& local_to_parent_transform) { const AffineTransform& local_to_parent_transform) {
// The distance to expand the cull rect for scrolling contents. DCHECK(RuntimeEnabledFeatures::SlimmingPaintV2Enabled());
static const int kPixelDistanceToExpand = 4000;
rect_.Intersect(overflow_clip_rect); rect_.Intersect(overflow_clip_rect);
UpdateCullRect(local_to_parent_transform); UpdateCullRect(local_to_parent_transform);
// TODO(wangxianzhu, chrishtr): How about non-composited scrolling contents? // TODO(wangxianzhu, chrishtr): How about non-composited scrolling contents?
// The distance to expand the cull rect for scrolling contents.
static const int kPixelDistanceToExpand = 4000;
rect_.Inflate(kPixelDistanceToExpand); rect_.Inflate(kPixelDistanceToExpand);
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "platform/geometry/FloatRect.h" #include "platform/geometry/FloatRect.h"
#include "platform/geometry/LayoutRect.h" #include "platform/geometry/LayoutRect.h"
#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
namespace blink { namespace blink {
...@@ -65,6 +66,8 @@ TEST_F(CullRectTest, IntersectsHorizontalRange) { ...@@ -65,6 +66,8 @@ TEST_F(CullRectTest, IntersectsHorizontalRange) {
} }
TEST_F(CullRectTest, UpdateForScrollingContents) { TEST_F(CullRectTest, UpdateForScrollingContents) {
ScopedSlimmingPaintV2ForTest spv2(true);
CullRect cull_rect(IntRect(0, 0, 50, 100)); CullRect cull_rect(IntRect(0, 0, 50, 100));
AffineTransform transform; AffineTransform transform;
transform.Translate(10, 15); transform.Translate(10, 15);
......
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