Index: src/core/SkMatrixImageFilter.cpp |
diff --git a/src/core/SkMatrixImageFilter.cpp b/src/core/SkMatrixImageFilter.cpp |
index 4370ddadee2e42b2d9ef909b55028066ba0ebb5f..4138ccf67759f5704a5e9f43df964419a617980f 100644 |
--- a/src/core/SkMatrixImageFilter.cpp |
+++ b/src/core/SkMatrixImageFilter.cpp |
@@ -97,30 +97,33 @@ void SkMatrixImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) cons |
getInput(0)->computeFastBounds(src, &bounds); |
} |
fTransform.mapRect(dst, bounds); |
+#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS |
dst->join(bounds); // Work around for skia:3194 |
+#endif |
} |
-bool SkMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, |
- SkIRect* dst) const { |
- SkMatrix transformInverse; |
- if (!fTransform.invert(&transformInverse)) { |
- return false; |
- } |
+void SkMatrixImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm, |
+ SkIRect* dst, MapDirection direction) const { |
SkMatrix matrix; |
if (!ctm.invert(&matrix)) { |
- return false; |
+ *dst = src; |
+ return; |
+ } |
+ if (kForward_MapDirection == direction) { |
+ matrix.postConcat(fTransform); |
+ } else { |
+ SkMatrix transformInverse; |
+ if (!fTransform.invert(&transformInverse)) { |
+ *dst = src; |
+ return; |
+ } |
+ matrix.postConcat(transformInverse); |
} |
- matrix.postConcat(transformInverse); |
matrix.postConcat(ctm); |
SkRect floatBounds; |
matrix.mapRect(&floatBounds, SkRect::Make(src)); |
SkIRect bounds = floatBounds.roundOut(); |
- if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { |
- return false; |
- } |
- |
*dst = bounds; |
- return true; |
} |
#ifndef SK_IGNORE_TO_STRING |