Allow GrShadowRRectOp::Make to fail
Change-Id: Ia325c711143c76db27b7dd9dd02ea8bea13f2806 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209100 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
e8a33ec6d0
commit
e5763787f9
@ -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;
|
||||
|
@ -642,6 +642,10 @@ std::unique_ptr<GrDrawOp> 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<ShadowCircularRRectOp>(color, bounds,
|
||||
|
Loading…
Reference in New Issue
Block a user