diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index f4896cb12b..c42ee860f3 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1415,8 +1415,9 @@ void SkCanvas::internalDrawDevice(SkBaseDevice* srcDev, int x, int y, const SkPa paint = &looper.paint(); SkImageFilter* filter = paint->getImageFilter(); SkIPoint pos = { x - iter.getX(), y - iter.getY() }; - if (filter) { - dstDev->drawSpecial(iter, srcDev->snapSpecial().get(), pos.x(), pos.y(), *paint); + sk_sp specialImage; + if (filter && (specialImage = srcDev->snapSpecial())) { + dstDev->drawSpecial(iter, specialImage.get(), pos.x(), pos.y(), *paint); } else { dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); }