Skip to content

Commit

Permalink
[Blink] Unify replaced element clipping
Browse files Browse the repository at this point in the history
Prior to this CL each replaced element type implemented its own clipping.
This CL refactors it so that a clip node will be applied in the common
path, ReplacedPainter::Paint(), so the specialized
XyzPainter::PaintReplaced() won't need to apply their own clips.

Note that ImagePainter still mutates its internal painting for changed
clip rect. This behavior should be changed in a follow-up CL, and
changing only the content box of a replaced element should only result
in incremental invalidation.

BUG=730284

Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia5c1412b1bd3182a22849d0b3196f3e72d52248a
Reviewed-on: https://chromium-review.googlesource.com/1147617
Commit-Queue: Tien-Ren Chen <trchen@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577741}
  • Loading branch information
trchen1033 authored and Commit Bot committed Jul 25, 2018
1 parent 5e236ec commit 05d439b
Show file tree
Hide file tree
Showing 59 changed files with 1,071 additions and 234 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"object": "LayoutImage IMG",
"rect": [151, 117, 100, 100],
"reason": "appeared"
},
{
"object": "LayoutImage IMG",
"rect": [151, 117, 100, 100],
"reason": "chunk appeared"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@
{
"object": "InlineTextBox 'Chromium'",
"rect": [40, 107, 113, 27],
"reason": "geometry"
"reason": "chunk appeared"
},
{
"object": "InlineTextBox 'Chromium'",
"rect": [8, 107, 113, 27],
"reason": "geometry"
"reason": "disappeared"
},
{
"object": "LayoutImage IMG id='foo'",
"rect": [8, 88, 32, 32],
"reason": "appeared"
},
{
"object": "LayoutImage IMG id='foo'",
"rect": [8, 88, 32, 32],
"reason": "chunk appeared"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
"paintInvalidations": [
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [50, 50, 600, 500],
"rect": [50, 50, 500, 500],
"reason": "geometry"
},
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [550, 50, 100, 500],
"reason": "incremental"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [550, 50, 100, 500],
"reason": "incremental"
},
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [550, 50, 100, 500],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"rect": [8, 74, 204, 232],
"reason": "geometry"
},
{
"object": "LayoutImage IMG",
"rect": [102, 74, 110, 232],
"reason": "incremental"
},
{
"object": "LayoutImage IMG",
"rect": [8, 74, 94, 232],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"object": "LayoutImage IMG",
"rect": [8, 8, 114, 232],
"reason": "geometry"
},
{
"object": "LayoutImage IMG",
"rect": [122, 8, 80, 232],
"reason": "incremental"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutIFrame IFRAME id='iframe'",
"rect": [8, 72, 732, 94],
"reason": "disappeared"
"object": "LayoutBlockFlow HTML",
"rect": [8, 16, 751, 150],
"reason": "chunk disappeared"
},
{
"object": "LayoutBlockFlow HTML",
"rect": [8, 16, 751, 39],
"reason": "chunk appeared"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutIFrame IFRAME id='iframe'",
"rect": [8, 72, 732, 94],
"reason": "appeared"
"object": "LayoutBlockFlow HTML",
"rect": [8, 16, 751, 150],
"reason": "chunk appeared"
},
{
"object": "LayoutBlockFlow HTML",
"rect": [8, 16, 751, 39],
"reason": "chunk disappeared"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutBlockFlow HTML",
"rect": [50, 50, 259, 194],
"reason": "chunk disappeared"
},
{
"object": "LayoutImage IMG",
"rect": [50, 50, 259, 194],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@
"paintInvalidations": [
{
"object": "LayoutImage (positioned) IMG",
"rect": [0, 50, 150, 150],
"rect": [0, 50, 100, 200],
"reason": "geometry"
},
{
"object": "LayoutImage (positioned) IMG",
"rect": [0, 50, 100, 200],
"rect": [0, 50, 100, 150],
"reason": "geometry"
},
{
"object": "LayoutImage (positioned) IMG",
"rect": [0, 200, 100, 50],
"reason": "incremental"
},
{
"object": "LayoutImage (positioned) IMG",
"rect": [100, 50, 50, 150],
"reason": "incremental"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@
"paintInvalidations": [
{
"object": "LayoutImage (positioned) IMG",
"rect": [0, 50, 150, 150],
"rect": [0, 50, 100, 200],
"reason": "geometry"
},
{
"object": "LayoutImage (positioned) IMG",
"rect": [0, 50, 100, 200],
"rect": [0, 50, 100, 150],
"reason": "geometry"
},
{
"object": "LayoutImage (positioned) IMG",
"rect": [0, 200, 100, 50],
"reason": "incremental"
},
{
"object": "LayoutImage (positioned) IMG",
"rect": [100, 50, 50, 150],
"reason": "incremental"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"rect": [48, 100, 100, 100],
"reason": "geometry"
},
{
"object": "LayoutImage IMG id='target'",
"rect": [48, 150, 100, 50],
"reason": "incremental"
},
{
"object": "LayoutListMarker (anonymous)",
"rect": [30, 185, 7, 19],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"object": "LayoutImage IMG",
"rect": [8, 64, 114, 232],
"reason": "geometry"
},
{
"object": "LayoutImage IMG",
"rect": [122, 64, 100, 232],
"reason": "incremental"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@
"paintInvalidations": [
{
"object": "LayoutImage (relative positioned) IMG id='test' class='moved'",
"rect": [8, 132, 214, 232],
"rect": [8, 52, 214, 232],
"reason": "geometry"
},
{
"object": "LayoutImage (relative positioned) IMG id='test' class='moved'",
"rect": [8, 52, 214, 232],
"rect": [8, 132, 214, 152],
"reason": "geometry"
},
{
"object": "LayoutImage (relative positioned) IMG id='test' class='moved'",
"rect": [8, 284, 214, 80],
"reason": "incremental"
},
{
"object": "LayoutImage (relative positioned) IMG id='test' class='moved'",
"rect": [8, 52, 214, 80],
"reason": "incremental"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"object": "LayoutImage IMG",
"rect": [100, 300, 50, 50],
"reason": "selection"
},
{
"object": "LayoutImage IMG",
"rect": [100, 300, 50, 50],
"reason": "chunk disappeared"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@
"rect": [0, 28, 266, 278],
"reason": "paint property change"
},
{
"object": "LayoutImage IMG id='box' class='smaller'",
"rect": [28, 28, 200, 200],
"reason": "paint property change"
},
{
"object": "LayoutImage IMG id='box' class='smaller'",
"rect": [9, 28, 138, 139],
"reason": "paint property change"
},
{
"object": "LayoutImage IMG id='box' class='smaller'",
"rect": [28, 28, 100, 100],
"reason": "paint property change"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,32 @@ Canvas log:
}
}
}
10 : {
commandIndex : 10
method : "restore"
params : undefined
}
2 : {
commandIndex : 2
method : "save"
params : undefined
}
3 : {
commandIndex : 3
method : "clipRect"
params : {
SkRegion::Op : "kIntersect_Op"
rect : {
bottom : 71
left : 0
right : 19
top : 50
}
softClipEdgeStyle : true
}
}
4 : {
commandIndex : 4
method : "drawImageRect"
params : {
dst : {
Expand Down Expand Up @@ -97,21 +121,26 @@ Canvas log:
}
}
}
3 : {
commandIndex : 3
5 : {
commandIndex : 5
method : "restore"
params : undefined
}
6 : {
commandIndex : 6
method : "save"
params : undefined
}
4 : {
commandIndex : 4
7 : {
commandIndex : 7
method : "translate"
params : {
dx : 0
dy : 71
}
}
5 : {
commandIndex : 5
8 : {
commandIndex : 8
method : "clipRect"
params : {
SkRegion::Op : "kIntersect_Op"
Expand All @@ -124,8 +153,8 @@ Canvas log:
softClipEdgeStyle : true
}
}
6 : {
commandIndex : 6
9 : {
commandIndex : 9
method : "drawRect"
params : {
paint : {
Expand All @@ -152,10 +181,5 @@ Canvas log:
}
}
}
7 : {
commandIndex : 7
method : "restore"
params : undefined
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"object": "LayoutImage IMG",
"rect": [151, 117, 100, 100],
"reason": "appeared"
},
{
"object": "LayoutImage IMG",
"rect": [151, 117, 100, 100],
"reason": "chunk appeared"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
"paintInvalidations": [
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [50, 50, 600, 500],
"rect": [50, 50, 500, 500],
"reason": "geometry"
},
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [550, 50, 100, 500],
"reason": "incremental"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"contentsOpaque": true,
"backgroundColor": "#FFFFFF",
"paintInvalidations": [
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [550, 50, 100, 500],
"reason": "incremental"
},
{
"object": "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
"rect": [550, 50, 100, 500],
Expand Down
Loading

0 comments on commit 05d439b

Please sign in to comment.