From f0c44e01287e153c1cccbb0e12d53cc3b1c0ebce Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Thu, 20 Mar 2014 23:41:00 -0700 Subject: Fix failure to run in EGL mode In addition to breaking out the cairo and skia claims on the egl context separately, we also need to call eglMakeCurrent and eglSwapBuffers so that it will actually draw to the screen. --- src/egl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/egl.cpp') diff --git a/src/egl.cpp b/src/egl.cpp index ee34f5f..5f04110 100644 --- a/src/egl.cpp +++ b/src/egl.cpp @@ -8,6 +8,7 @@ #include #endif +#include #include "egl.h" @@ -27,7 +28,7 @@ createEGLContextAndWindow(egl_state_t *state, int width, int height) EGL_NONE }; EGLint ctx_attr[] = { - EGL_CONTEXT_CLIENT_VERSION, 3, + EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; EGLConfig config; @@ -87,8 +88,11 @@ void destroyEGLContextAndWindow (egl_state_t *state) { if (state->egl_display) { + eglMakeCurrent (state->egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglDestroyContext (state->egl_display, state->egl_context); eglDestroySurface (state->egl_display, state->egl_surface); + state->egl_context = EGL_NO_CONTEXT; + state->egl_surface = EGL_NO_SURFACE; eglTerminate (state->egl_display); } -- cgit v1.3.1-4-g156e