Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: gm/image.cpp

Issue 1976163002: GMs: fail gracefully for null surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix another GM Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gm/image_pict.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/image.cpp
diff --git a/gm/image.cpp b/gm/image.cpp
index a84e19b3f7758bc8c0017b183a37ca6b6b7b39aa..b57ec3a687e4b93c75ef3c27b2b97220945374e1 100644
--- a/gm/image.cpp
+++ b/gm/image.cpp
@@ -258,6 +258,7 @@ static sk_sp<SkImage> make_codec(const SkImageInfo& info, GrContext*, void (*dra
static sk_sp<SkImage> make_gpu(const SkImageInfo& info, GrContext* ctx, void (*draw)(SkCanvas*)) {
if (!ctx) { return nullptr; }
auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info));
+ if (!surface) { return nullptr; }
draw(surface->getCanvas());
return surface->makeImageSnapshot();
}
« no previous file with comments | « no previous file | gm/image_pict.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698