diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index 224fc365db..0bc18c21dd 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -1353,8 +1353,9 @@ bool GrRenderTargetContext::drawFastShadow(const GrClip& clip, ambientRRect, devSpaceAmbientBlur, devSpaceInsetWidth); - SkASSERT(op); - this->addDrawOp(clip, std::move(op)); + if (op) { + this->addDrawOp(clip, std::move(op)); + } } if (SkColorGetA(rec.fSpotColor) > 0) { @@ -1450,8 +1451,9 @@ bool GrRenderTargetContext::drawFastShadow(const GrClip& clip, spotShadowRRect, 2.0f * devSpaceSpotBlur, insetWidth); - SkASSERT(op); - this->addDrawOp(clip, std::move(op)); + if (op) { + this->addDrawOp(clip, std::move(op)); + } } return true; diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp index 5ee0b37ff4..50ac40f16c 100644 --- a/src/gpu/ops/GrShadowRRectOp.cpp +++ b/src/gpu/ops/GrShadowRRectOp.cpp @@ -642,6 +642,10 @@ std::unique_ptr Make(GrRecordingContext* context, SkScalar scaledRadius = SkScalarAbs(radius*matrixFactor); SkScalar scaledInsetWidth = SkScalarAbs(insetWidth*matrixFactor); + if (scaledInsetWidth <= 0) { + return nullptr; + } + GrOpMemoryPool* pool = context->priv().opMemoryPool(); return pool->allocate(color, bounds,