Index: src/effects/SkOffsetImageFilter.cpp |
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp |
index 9da026b2793b8998a321cacb20cb9cf6d1e4591b..c4fc5ebe304eea1eb02da771489527221376515f 100644 |
--- a/src/effects/SkOffsetImageFilter.cpp |
+++ b/src/effects/SkOffsetImageFilter.cpp |
@@ -70,24 +70,28 @@ void SkOffsetImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) cons |
} else { |
*dst = src; |
} |
+#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS |
SkRect copy = *dst; |
+#endif |
dst->offset(fOffset.fX, fOffset.fY); |
+#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS |
dst->join(copy); |
+#endif |
} |
-bool SkOffsetImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, |
- SkIRect* dst) const { |
+void SkOffsetImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm, |
+ SkIRect* dst, MapDirection direction) const { |
SkVector vec; |
ctm.mapVectors(&vec, &fOffset, 1); |
- |
- SkIRect bounds = src; |
- bounds.offset(-SkScalarCeilToInt(vec.fX), -SkScalarCeilToInt(vec.fY)); |
- bounds.join(src); |
- if (getInput(0)) { |
- return getInput(0)->filterBounds(bounds, ctm, dst); |
+ if (kReverse_MapDirection == direction) { |
+ vec.negate(); |
} |
- *dst = bounds; |
- return true; |
+ |
+ *dst = src; |
+ dst->offset(SkScalarCeilToInt(vec.fX), SkScalarCeilToInt(vec.fY)); |
+#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS |
+ dst->join(src); |
+#endif |
} |
SkFlattenable* SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) { |