OSDN Git Service

Fix the GLES version number in the emulator encoder
authorYahan Zhou <yahan@google.com>
Fri, 29 Jan 2016 20:12:57 +0000 (12:12 -0800)
committerYahan Zhou <yahan@google.com>
Wed, 3 Feb 2016 01:41:38 +0000 (01:41 +0000)
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

index 4ce0888..87ae4ad 100644 (file)
@@ -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) {