aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-05-09 15:12:23 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-10 12:59:02 +0000
commit21015b7004248c46233f1678eeaba69223d68769 (patch)
treecfff054ee806773e41f62960842d995315d5c780 /src/core
parentd31b2f674acc24b44fe68cea872109d96da4c796 (diff)
Fix clipping of SkMatrixImageFilter input (take 2)
This cannot land before the Chrome CL https://chromium-review.googlesource.com/c/chromium/src/+/1052850 (Add a flag to ignore an upcoming Skia bug fix that changes layout and unit tests) Bug: skia:7931 Change-Id: I2951a727bd3f61aeda0e1e322cd76e48f677f75f Reviewed-on: https://skia-review.googlesource.com/127125 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.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp
index a27ca980f1..f9b53348b1 100644
--- a/src/core/SkMatrixImageFilter.cpp
+++ b/src/core/SkMatrixImageFilter.cpp
@@ -131,7 +131,17 @@ 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();
+
+#ifndef SK_IGNORE_MATRIX_IMAGE_FILTER_FIX
+ 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);
+ }
+#endif
+
+ return result;
}
void SkMatrixImageFilter::toString(SkString* str) const {