egl: treat EGL_OPENGL_API as invalid on Android
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 25 Aug 2016 11:02:07 +0000 (12:02 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 30 Aug 2016 13:49:24 +0000 (14:49 +0100)
At the moment one can use OpenGL in eglBindAPI() only to clear the
EGL_OPENGL_BIT from RenderableType and Conformant for _each_ config.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
src/egl/main/eglcurrent.h

index 1e386acdafb9c0550801536da02e2af85f56bcb6..3f8a0b28e38393a31dcadd7c58b965a6720b4706 100644 (file)
@@ -69,7 +69,13 @@ struct _egl_thread_info
 static inline EGLBoolean
 _eglIsApiValid(EGLenum api)
 {
-   return (api >= _EGL_API_FIRST_API && api <= _EGL_API_LAST_API);
+#ifdef ANDROID
+   /* OpenGL is not a valid/supported API on Android */
+   return api >= _EGL_API_FIRST_API && api <= _EGL_API_LAST_API &&
+          api != EGL_OPENGL_API;
+#else
+   return api >= _EGL_API_FIRST_API && api <= _EGL_API_LAST_API;
+#endif
 }