aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 153c6f4c48..848676afaf 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -403,15 +403,16 @@ sk_sp<SkSpecialImage> SkMatrixConvolutionImageFilter::onFilterImage(SkSpecialIma
dstBounds.offset(-inputOffset);
srcBounds.offset(-inputOffset);
- SkIRect interior = SkIRect::MakeXYWH(dstBounds.left() + fKernelOffset.fX,
- dstBounds.top() + fKernelOffset.fY,
- dstBounds.width() - fKernelSize.fWidth + 1,
- dstBounds.height() - fKernelSize.fHeight + 1);
-
+ SkIRect interior;
if (kRepeat_TileMode == fTileMode) {
- // In repeat mode the above computation of interior can exceed the bounds of 'dst'.
- interior.sort();
- interior.intersect(dstBounds);
+ // In repeat mode, the filterPixels calls will wrap around
+ // so we just need to render 'dstBounds'
+ interior = dstBounds;
+ } else {
+ interior = SkIRect::MakeXYWH(dstBounds.left() + fKernelOffset.fX,
+ dstBounds.top() + fKernelOffset.fY,
+ dstBounds.width() - fKernelSize.fWidth + 1,
+ dstBounds.height() - fKernelSize.fHeight + 1);
}
SkIRect top = SkIRect::MakeLTRB(dstBounds.left(), dstBounds.top(),