diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBlurImageFilter.cpp | 4 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 8 | ||||
-rw-r--r-- | src/core/SkSpecialSurface.cpp | 3 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/core/SkBlurImageFilter.cpp b/src/core/SkBlurImageFilter.cpp index d531b44393..7590fdcc57 100644 --- a/src/core/SkBlurImageFilter.cpp +++ b/src/core/SkBlurImageFilter.cpp @@ -136,7 +136,9 @@ sk_sp<SkSpecialImage> SkBlurImageFilterImpl::onFilterImage(SkSpecialImage* sourc if (source->isTextureBacked()) { GrContext* context = source->getContext(); sk_sp<GrTexture> inputTexture(input->asTextureRef(context)); - SkASSERT(inputTexture); + if (!inputTexture) { + return nullptr; + } if (0 == sigma.x() && 0 == sigma.y()) { offset->fX = inputBounds.x(); diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index eddf106ae4..aa74a642a8 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1419,9 +1419,11 @@ 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() }; - sk_sp<SkSpecialImage> specialImage; - if (filter && (specialImage = srcDev->snapSpecial())) { - dstDev->drawSpecial(iter, specialImage.get(), pos.x(), pos.y(), *paint); + if (filter) { + sk_sp<SkSpecialImage> specialImage = srcDev->snapSpecial(); + if (specialImage) { + dstDev->drawSpecial(iter, specialImage.get(), pos.x(), pos.y(), *paint); + } } else { dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); } diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp index f0c66ae1d7..956300cb3e 100644 --- a/src/core/SkSpecialSurface.cpp +++ b/src/core/SkSpecialSurface.cpp @@ -136,6 +136,9 @@ public: ~SkSpecialSurface_Gpu() override { } sk_sp<SkSpecialImage> onMakeImageSnapshot() override { + if (!fRenderTargetContext->asTexture()) { + return nullptr; + } sk_sp<SkSpecialImage> tmp(SkSpecialImage::MakeFromGpu( this->subset(), kNeedNewImageUniqueID_SpecialImage, |