summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2013-09-14 21:00:14 -0700
committerJesse Hall <jessehall@google.com>2013-09-16 11:21:48 -0700
commita2ba428a22125558a129c6ba4001dfc2169de2fe (patch)
treea208e80fa38245dc7c0ac7cd1c560355eb97209a /opengl
parent90ed3e8d7883d9c80fb8bf11b1c593bd8b2b39d0 (diff)
downloadframeworks_native-a2ba428a22125558a129c6ba4001dfc2169de2fe.zip
frameworks_native-a2ba428a22125558a129c6ba4001dfc2169de2fe.tar.gz
frameworks_native-a2ba428a22125558a129c6ba4001dfc2169de2fe.tar.bz2
Disable the egl_khr_gl_colorspace extension
Bug: 10777398 Change-Id: Ib50ea8b9d5d960537701b85929d6312304993a0f
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/eglApi.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index d3bc14a..04d5f45 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -49,6 +49,10 @@
using namespace android;
+// This extension has not been ratified yet, so can't be shipped.
+// Implementation is incomplete and untested.
+#define ENABLE_EGL_KHR_GL_COLORSPACE 0
+
// ----------------------------------------------------------------------------
namespace android {
@@ -82,7 +86,9 @@ extern char const * const gExtensionString =
"EGL_KHR_image_base " // mandatory
"EGL_KHR_image_pixmap "
"EGL_KHR_lock_surface "
+#if (ENABLE_EGL_KHR_GL_COLORSPACE != 0)
"EGL_KHR_gl_colorspace "
+#endif
"EGL_KHR_gl_texture_2D_image "
"EGL_KHR_gl_texture_cubemap_image "
"EGL_KHR_gl_renderbuffer_image "
@@ -366,7 +372,7 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
// surfaces
// ----------------------------------------------------------------------------
-// The EGL_KHR_gl_colorspace spec hasn't been published yet, so these haven't
+// The EGL_KHR_gl_colorspace spec hasn't been ratified yet, so these haven't
// been added to the Khronos egl.h.
#define EGL_GL_COLORSPACE_KHR EGL_VG_COLORSPACE
#define EGL_GL_COLORSPACE_SRGB_KHR EGL_VG_COLORSPACE_sRGB
@@ -427,7 +433,17 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
attr += 2) {
if (*attr == EGL_GL_COLORSPACE_KHR &&
dp->haveExtension("EGL_KHR_gl_colorspace")) {
- format = modifyFormatColorspace(format, *(attr+1));
+ if (ENABLE_EGL_KHR_GL_COLORSPACE) {
+ format = modifyFormatColorspace(format, *(attr+1));
+ } else {
+ // Normally we'd pass through unhandled attributes to
+ // the driver. But in case the driver implements this
+ // extension but we're disabling it, we want to prevent
+ // it getting through -- support will be broken without
+ // our help.
+ ALOGE("sRGB window surfaces not supported");
+ return setError(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
+ }
}
}
}
@@ -458,7 +474,17 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
if (attrib_list && dp->haveExtension("EGL_KHR_gl_colorspace")) {
for (const EGLint* attr = attrib_list; *attr != EGL_NONE; attr += 2) {
if (*attr == EGL_GL_COLORSPACE_KHR) {
- format = modifyFormatColorspace(format, attr[1]);
+ if (ENABLE_EGL_KHR_GL_COLORSPACE) {
+ format = modifyFormatColorspace(format, *(attr+1));
+ } else {
+ // Normally we'd pass through unhandled attributes to
+ // the driver. But in case the driver implements this
+ // extension but we're disabling it, we want to prevent
+ // it getting through -- support will be broken without
+ // our help.
+ ALOGE("sRGB window surfaces not supported");
+ return setError(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
+ }
}
}
}