Index: src/core/SkImageFilter.cpp |
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp |
index 95793025e8a0015cbc1133541156684ba54dd576..25eecb0b5d67b4dbeea15391541be513f15e29e4 100644 |
--- a/src/core/SkImageFilter.cpp |
+++ b/src/core/SkImageFilter.cpp |
@@ -391,11 +391,15 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont |
} |
bool SkImageFilter::applyCropRect(const Context& ctx, const SkBitmap& src, |
- const SkIPoint& srcOffset, SkIRect* bounds) const { |
- SkIRect srcBounds; |
- src.getBounds(&srcBounds); |
- srcBounds.offset(srcOffset); |
- return fCropRect.applyTo(srcBounds, ctx, bounds); |
+ const SkIPoint& srcOffset, SkIRect* dstBounds, |
+ SkIRect* srcBounds) const { |
+ SkIRect storage; |
+ if (!srcBounds) { |
+ srcBounds = &storage; |
+ } |
+ src.getBounds(srcBounds); |
+ srcBounds->offset(srcOffset); |
+ return fCropRect.applyTo(*srcBounds, ctx, dstBounds) && srcBounds->intersect(*dstBounds); |
} |
bool SkImageFilter::applyCropRect(const Context& ctx, Proxy* proxy, const SkBitmap& src, |