Fix a bug in the Clamp in X direction tiling.

The code mixed up which end of the span was cut and preserved in the
sequence of span breaks.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2145193002

Review-Url: https://codereview.chromium.org/2145193002
This commit is contained in:
herb 2016-07-14 14:50:48 -07:00 committed by Commit bot
parent 970587bf0e
commit 494c2b6fa1

View File

@ -90,19 +90,18 @@ public:
next->pointSpan(span);
}
} else {
Span center = span.breakAt(fXMax, dx);
if (!span.isEmpty()) {
span.clampToSinglePixel({fXMax - 1, y});
next->pointSpan(span);
Span rightClamped = span.breakAt(fXMax, dx);
if (!rightClamped.isEmpty()) {
rightClamped.clampToSinglePixel({fXMax - 1, y});
next->pointSpan(rightClamped);
}
Span leftEdge = center.breakAt(0.0f, dx);
Span center = span.breakAt(0.0f, dx);
if (!center.isEmpty()) {
next->pointSpan(center);
}
if (!leftEdge.isEmpty()) {
leftEdge.clampToSinglePixel({0.0f, y});
next->pointSpan(leftEdge);
if (!span.isEmpty()) {
span.clampToSinglePixel({0.0f, y});
next->pointSpan(span);
}
}
return true;