Index: src/effects/SkTileImageFilter.cpp |
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp |
index 52ea6a756f1cfcf8e78da08debb869d0224142a7..8ef617d520f96dfc05c77a3d3b67dc02fdbc1b23 100644 |
--- a/src/effects/SkTileImageFilter.cpp |
+++ b/src/effects/SkTileImageFilter.cpp |
@@ -81,21 +81,30 @@ bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, |
return true; |
} |
+void SkTileImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm, |
+ SkIRect* dst, MapDirection direction) const { |
+ SkRect rect = kReverse_MapDirection == direction ? fSrcRect : fDstRect; |
+ ctm.mapRect(&rect); |
+ rect.roundOut(dst); |
+#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS |
+ dst->join(src); |
+#endif |
+} |
+ |
bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, |
SkIRect* dst) const { |
- SkRect srcRect; |
- ctm.mapRect(&srcRect, fSrcRect); |
- SkIRect srcIRect; |
- srcRect.roundOut(&srcIRect); |
- srcIRect.join(src); |
- *dst = srcIRect; |
+ this->onFilterNodeBounds(src, ctm, dst, kReverse_MapDirection); |
return true; |
} |
void SkTileImageFilter::computeFastBounds(const SkRect& src, SkRect* dst) const { |
+#ifdef SK_SUPPORT_SRC_BOUNDS_BLOAT_FOR_IMAGEFILTERS |
// This is a workaround for skia:3194. |
*dst = src; |
dst->join(fDstRect); |
+#else |
+ *dst = fDstRect; |
+#endif |
} |
SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) { |