aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/imagealphathreshold.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-12-20 19:05:09 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-21 02:06:15 +0000
commit253b4dd51fab530054bcf28a59341b4bd1622430 (patch)
tree7b922f21df7f9b4f12dac694627812711b256af0 /gm/imagealphathreshold.cpp
parent144a5c518ae921f210bdd9647c061e57d18f440c (diff)
Handle failed surface creation in AlphaThresholdImageFilter GM
Change-Id: Ibc27d26a9afc1f88d5ca7de2216e09afa10ce846 Reviewed-on: https://skia-review.googlesource.com/6354 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm/imagealphathreshold.cpp')
-rw-r--r--gm/imagealphathreshold.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gm/imagealphathreshold.cpp b/gm/imagealphathreshold.cpp
index 302cdeea52..193423d326 100644
--- a/gm/imagealphathreshold.cpp
+++ b/gm/imagealphathreshold.cpp
@@ -131,6 +131,9 @@ protected:
sk_sp<SkSurface> surface(make_color_matching_surface(canvas, WIDTH, HEIGHT,
kPremul_SkAlphaType));
+ if (!surface) {
+ return;
+ }
surface->getCanvas()->clear(SK_ColorTRANSPARENT);
draw_rects(surface->getCanvas());