Commit 501d97b0 authored by karlo's avatar karlo Committed by Commit bot

Fix for performance regression on high dpi devices.

ComputedStyle::getRoundedInnerBorderFor() could generate negative
content boxes for boxes with no content and sub pixel borders that
round up (eg. 1.5px-1.99px).  Negative content boxes are illegal per
spec, and causes BoxBorderPainter::paintBorderFastPath() to bail,
and performance to be substantially degraded.

This issue would be evident on the paint-offset-changes perftest when
device pixel ratio was set to eg. 1.5.  The issue was introduced in
934becac

BUG=692955

Review-Url: https://codereview.chromium.org/2782153002
Cr-Commit-Position: refs/heads/master@{#460534}
parent 5e6e3230
......@@ -1490,7 +1490,9 @@ FloatRoundedRect ComputedStyle::getRoundedInnerBorderFor(
bool includeLogicalRightEdge) const {
LayoutRect innerRect(borderRect);
innerRect.expand(insets);
innerRect.size().clampNegativeToZero();
LayoutSize innerRectSize = innerRect.size();
innerRectSize.clampNegativeToZero();
innerRect.setSize(innerRectSize);
FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect));
......
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