diff options
| author | Bryce Harrington <b.harrington@samsung.com> | 2014-03-21 10:52:20 -0700 |
|---|---|---|
| committer | Bryce Harrington <b.harrington@samsung.com> | 2014-03-21 10:52:20 -0700 |
| commit | 1d9754415d5fdfdbe6adcc46721575f0bbd163bb (patch) | |
| tree | be7b03dc63c5752f571db208e6ac7b4d0444cd16 /src/skia-egl.cpp | |
| parent | f0c44e01287e153c1cccbb0e12d53cc3b1c0ebce (diff) | |
Add error checking on GrContext::Create() call
Diffstat (limited to 'src/skia-egl.cpp')
| -rw-r--r-- | src/skia-egl.cpp | 6 |
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); |