Add error return, upon mask creation failure, in sw_draw_with_mask_filter

Bug: 822680

Change-Id: I7296c5be4faf1f706ad1cc05198559771e324841
Reviewed-on: https://skia-review.googlesource.com/116180
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2018-03-23 10:33:12 -04:00 committed by Skia Commit-Bot
parent fbca7db22a
commit 48ce22b374

View File

@ -92,12 +92,18 @@ static bool sw_draw_with_mask_filter(GrContext* context,
bm.setImmutable();
sk_sp<SkImage> image = SkImage::MakeFromBitmap(bm);
if (!image) {
return false;
}
auto proxyProvider = context->contextPriv().proxyProvider();
sk_sp<GrTextureProxy> maskProxy = proxyProvider->createTextureProxy(std::move(image),
kNone_GrSurfaceFlags,
1, SkBudgeted::kYes,
SkBackingFit::kApprox);
if (!maskProxy) {
return false;
}
return draw_mask(renderTargetContext, clipData, viewMatrix,
dstM.fBounds, std::move(paint), std::move(maskProxy));