Index: src/core/SkDevice.cpp |
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp |
index 4c53ad4189a4ca758b8de18dc99afef05afe6e54..1b228565283cc1cc8cf36ed4a79d4b361591ee9f 100644 |
--- a/src/core/SkDevice.cpp |
+++ b/src/core/SkDevice.cpp |
@@ -409,29 +409,33 @@ |
SkImageFilter* filter = paint.getImageFilter(); |
SkASSERT(filter); |
- SkImageFilter::DeviceProxy proxy(this); |
- SkIPoint offset = SkIPoint::Make(0, 0); |
- SkMatrix matrix = *draw.fMatrix; |
- matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y)); |
- const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y); |
- SkAutoTUnref<SkImageFilter::Cache> cache(this->getImageFilterCache()); |
- SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); |
- |
- sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy, bitmap, |
- &this->surfaceProps())); |
- if (!srcImg) { |
- return; // something disastrous happened |
- } |
- |
- sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offset)); |
- if (resultImg) { |
- SkPaint tmpUnfiltered(paint); |
- tmpUnfiltered.setImageFilter(nullptr); |
- SkBitmap resultBM; |
- if (resultImg->internal_getBM(&resultBM)) { |
- // TODO: add drawSprite(SkSpecialImage) to SkDevice? (see skbug.com/5073) |
- this->drawSprite(draw, resultBM, x + offset.x(), y + offset.y(), tmpUnfiltered); |
- } |
+ if (!this->canHandleImageFilter(filter)) { |
+ SkImageFilter::DeviceProxy proxy(this); |
+ SkIPoint offset = SkIPoint::Make(0, 0); |
+ SkMatrix matrix = *draw.fMatrix; |
+ matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y)); |
+ const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y); |
+ SkAutoTUnref<SkImageFilter::Cache> cache(this->getImageFilterCache()); |
+ SkImageFilter::Context ctx(matrix, clipBounds, cache.get()); |
+ |
+ sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy, bitmap, |
+ &this->surfaceProps())); |
+ if (!srcImg) { |
+ return; // something disastrous happened |
+ } |
+ |
+ sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offset)); |
+ if (resultImg) { |
+ SkPaint tmpUnfiltered(paint); |
+ tmpUnfiltered.setImageFilter(nullptr); |
+ SkBitmap resultBM; |
+ if (resultImg->internal_getBM(&resultBM)) { |
+ // TODO: add drawSprite(SkSpecialImage) to SkDevice? (see skbug.com/5073) |
+ this->drawSprite(draw, resultBM, x + offset.x(), y + offset.y(), tmpUnfiltered); |
+ } |
+ } |
+ } else { |
+ this->drawSprite(draw, bitmap, x, y, paint); |
} |
} |