aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLinearBitmapPipeline_tile.h
diff options
context:
space:
mode:
authorGravatar herb <herb@google.com>2016-07-14 14:50:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-14 14:50:48 -0700
commit494c2b6fa125d85d99fb6e9b479f21f4f76c32bb (patch)
tree89c6c1d45fdcc10e5abf791354b3ccbfa629f816 /src/core/SkLinearBitmapPipeline_tile.h
parent970587bf0ed73807632be7b0f349a96995cee4ec (diff)
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
Diffstat (limited to 'src/core/SkLinearBitmapPipeline_tile.h')
-rw-r--r--src/core/SkLinearBitmapPipeline_tile.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/core/SkLinearBitmapPipeline_tile.h b/src/core/SkLinearBitmapPipeline_tile.h
index 6fe64f1bce..39d79a0061 100644
--- a/src/core/SkLinearBitmapPipeline_tile.h
+++ b/src/core/SkLinearBitmapPipeline_tile.h
@@ -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;