Index: src/effects/SkTileImageFilter.cpp |
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp |
index 8ef617d520f96dfc05c77a3d3b67dc02fdbc1b23..8d158013879a7bf23097c75a2ce241f49816bad6 100644 |
--- a/src/effects/SkTileImageFilter.cpp |
+++ b/src/effects/SkTileImageFilter.cpp |
@@ -35,6 +35,12 @@ bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, |
SkRect dstRect; |
ctx.ctm().mapRect(&dstRect, fDstRect); |
+#ifndef SK_DISABLE_TILE_IMAGE_FILTER_DEST_OPTIMIZATION |
+ if (!dstRect.intersect(SkRect::Make(ctx.clipBounds()))) { |
+ offset->fX = offset->fY = 0; |
+ return true; |
+ } |
+#endif |
const SkIRect dstIRect = dstRect.roundOut(); |
int w = dstIRect.width(); |
int h = dstIRect.height(); |