aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-05-09 11:53:49 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-09 17:05:45 +0000
commitcb8b5d1101d0a1bf7c78f3d1fec73afbe470994c (patch)
tree85a2bb9f55e5295ceea084bbbe9a30fa47efe43b /src/core
parent20880784fb7301d497225e7e7e4a3cd1452b8aae (diff)
Fix clipping of SkMatrixImageFilter input
Bug: skia:7931 Change-Id: I3e424dcd5c0b04542976f4f59a5836e7c3079d06 Reviewed-on: https://skia-review.googlesource.com/127020 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkMatrixImageFilter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp
index a27ca980f1..212b787d18 100644
--- a/src/core/SkMatrixImageFilter.cpp
+++ b/src/core/SkMatrixImageFilter.cpp
@@ -131,7 +131,15 @@ SkIRect SkMatrixImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatr
matrix.postConcat(ctm);
SkRect floatBounds;
matrix.mapRect(&floatBounds, SkRect::Make(src));
- return floatBounds.roundOut();
+ SkIRect result = floatBounds.roundOut();
+
+ if (kReverse_MapDirection == direction && kNone_SkFilterQuality != fFilterQuality) {
+ // When filtering we might need some pixels in the source that might be otherwise
+ // clipped off.
+ result.outset(1, 1);
+ }
+
+ return result;
}
void SkMatrixImageFilter::toString(SkString* str) const {