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

Unified Diff: gm/image_shader.cpp

Issue 1972933002: Fail gracefully if MakeRenderTarget fails (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/image_shader.cpp
diff --git a/gm/image_shader.cpp b/gm/image_shader.cpp
index 214b05d80cf3cf56e3716841311c05f97ecdda70..924199e6e7fcf0b3463d5b2acac134ce5fcb23ed 100644
--- a/gm/image_shader.cpp
+++ b/gm/image_shader.cpp
@@ -38,6 +38,9 @@ static sk_sp<SkImage> make_texture(GrContext* ctx, SkPicture* pic, const SkImage
return nullptr;
}
auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info));
+ if (!surface) {
+ return nullptr;
+ }
surface->getCanvas()->clear(0);
surface->getCanvas()->drawPicture(pic);
return surface->makeImageSnapshot();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698