Skip to content

Commit

Permalink
Reduce the requirement for saving previousLocation
Browse files Browse the repository at this point in the history
ObjectPaintInvalidator::previousLocationInBacking() accesses a global
map if location was different from visualRect.location() during the last
paint invalidation.

The percentage of LayoutObjects requiring to save previousLocation was
about 5% before SlimmingPaintInvalidation is enabled, but increased to
about 37% after.

The main reason was that we always called enclosingIntRect() when
computing visual rect, causing visualRect.location() was different from
location if location is not at whole pixels. Now call enclosingIntRect()
only when there is any transform.

A minor reason was about empty rects having different location. Location
of an empty visual rect actually has no actual functional effect on
paint invalidation. Now don't map empty rects, but force its location
to be the same as location in backing, so that we always don't need to
save previous location of empty visual rects.

BUG=685179
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2706063003
Cr-Commit-Position: refs/heads/master@{#451908}
  • Loading branch information
wangxianzhu authored and Commit bot committed Feb 22, 2017
1 parent b3d8f58 commit 8cc1739
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 1,219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
},
{
"object": "LayoutBlockFlow DIV id='left'",
"rect": [8, 68, 200, 145],
"reason": "border box change"
"rect": [8, 119, 200, 94],
"reason": "incremental"
},
{
"object": "LayoutBlockFlow DIV id='left'",
"rect": [8, 68, 200, 52],
"reason": "border box change"
"rect": [8, 116, 200, 4],
"reason": "incremental"
},
{
"object": "LayoutBlockFlow DIV",
Expand Down Expand Up @@ -52,7 +52,7 @@
"objectPaintInvalidations": [
{
"object": "LayoutBlockFlow DIV id='left'",
"reason": "border box change"
"reason": "incremental"
},
{
"object": "LayoutBlockFlow DIV id='content'",
Expand All @@ -64,7 +64,7 @@
},
{
"object": "LayoutBlockFlow DIV id='left'",
"reason": "border box change"
"reason": "incremental"
},
{
"object": "LayoutBlockFlow DIV id='content'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
{
"object": "LayoutBlockFlow DIV",
"rect": [0, 0, 300, 125],
"reason": "border box change"
"rect": [0, 62, 300, 63],
"reason": "incremental"
}
]
}
Expand All @@ -26,7 +26,7 @@
},
{
"object": "LayoutBlockFlow DIV",
"reason": "border box change"
"reason": "incremental"
}
]
}
Expand All @@ -38,15 +38,15 @@
"contentsOpaque": true,
"drawsContent": true,
"paintInvalidations": [
{
"object": "LayoutBlockFlow DIV",
"rect": [0, 0, 300, 63],
"reason": "border box change"
},
{
"object": "LayoutView #document",
"rect": [400, 0, 200, 250],
"reason": "incremental"
},
{
"object": "LayoutBlockFlow DIV",
"rect": [200, 0, 100, 63],
"reason": "incremental"
}
]
}
Expand All @@ -58,7 +58,7 @@
},
{
"object": "LayoutBlockFlow DIV",
"reason": "border box change"
"reason": "incremental"
}
]
}
Expand All @@ -77,8 +77,8 @@
},
{
"object": "LayoutBlockFlow DIV",
"rect": [0, 0, 200, 150],
"reason": "border box change"
"rect": [0, 62, 200, 88],
"reason": "incremental"
}
]
}
Expand All @@ -90,7 +90,7 @@
},
{
"object": "LayoutBlockFlow DIV",
"reason": "border box change"
"reason": "incremental"
}
]
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
},
{
"object": "LayoutBlockFlow DIV id='left'",
"rect": [8, 128, 140, 100],
"reason": "border box change"
"rect": [138, 128, 10, 100],
"reason": "incremental"
}
]
}
Expand Down Expand Up @@ -112,7 +112,7 @@
},
{
"object": "LayoutBlockFlow DIV id='left'",
"reason": "border box change"
"reason": "incremental"
},
{
"object": "LayoutBlockFlow DIV id='content'",
Expand Down

This file was deleted.

Loading

0 comments on commit 8cc1739

Please sign in to comment.