summaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2014-03-21 10:52:20 -0700
committerBryce Harrington <b.harrington@samsung.com>2014-03-21 10:52:20 -0700
commit1d9754415d5fdfdbe6adcc46721575f0bbd163bb (patch)
treebe7b03dc63c5752f571db208e6ac7b4d0444cd16
parentf0c44e01287e153c1cccbb0e12d53cc3b1c0ebce (diff)
Add error checking on GrContext::Create() call
-rw-r--r--src/skia-egl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/skia-egl.cpp b/src/skia-egl.cpp
index a39386f..e5fad8e 100644
--- a/src/skia-egl.cpp
+++ b/src/skia-egl.cpp
@@ -49,6 +49,12 @@ create_skia_device_egl (int width, int height)
desc.fStencilBits = 1;
desc.fRenderTargetHandle = 0;
ctx = GrContext::Create(kOpenGL_GrBackend, 0);
+ if (ctx == NULL) {
+ warnx("Could not establish a graphics context for Skia EGL\n");
+ cleanup_state_egl(state);
+ return NULL;
+ }
+
target = ctx->wrapBackendRenderTarget(desc);
device = new SkGpuDevice(ctx, target);