From 1755bf31053bcab2512fbeaab2118d214799ad05 Mon Sep 17 00:00:00 2001 From: Yahan Zhou Date: Fri, 29 Jan 2016 12:12:57 -0800 Subject: [PATCH] Fix the GLES version number in the emulator encoder The native code, emulator encoder and emulator decoder each keeps its own GLES version number. Previously they are inconsistent when EGL_CONTEXT_CLIENT_VERSION=3. In this patch, because our emulator currently doesn't support GLES3, we return EGL_NO_CONTEXT with an error code EGL_BAD_CONFIG when the user tries to use GLES 3. In future when we impelment GLES3, please remmeber to change the version number here, as well as those in native code and the emulator decoder. Release Note: Report error code when setting up GLES3 Change-Id: I1d1083310d28bb57f42625daaed710711495a3ed --- system/egl/egl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp index 4ce0888..87ae4ad 100644 --- a/system/egl/egl.cpp +++ b/system/egl/egl.cpp @@ -898,6 +898,11 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_c attrib_list+=2; } + // Currently only support GLES1 and 2 + if (version != 1 && version != 2) { + setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT); + } + uint32_t rcShareCtx = 0; EGLContext_t * shareCtx = NULL; if (share_context) { -- 2.11.0