summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtneygo@google.com>2017-06-23 09:06:52 -0600
committerCourtney Goeltzenleuchter <courtneygo@google.com>2017-08-01 10:51:43 -0600
commit2cd68e6d90ed5f62c84555d6a6e3655f488919a7 (patch)
tree9c66a66acc8e711cdd82615b10b9422eadcbb804
parent8e0c3f5f1c4ffc3a055fe016406bd6a549ebdd00 (diff)
downloadnative-2cd68e6d90ed5f62c84555d6a6e3655f488919a7.tar.gz
EGL: Add EGL_GL_scrgb extension
Test: Android CTS adb -d shell am start \ -n com.drawelements.deqp/android.app.NativeActivity \ -e cmdLine '"deqp --deqp-case=dEQP-EGL.functional.wide_color.* \ --deqp-log-filename=/sdcard/dEQP-Log.qpa"' Bug: 62424735 Change-Id: I12a0bd64c01bcf314b4a73d8eb3151b09bf9f8ae (cherry picked from commit 33e2b781a05f1caf274e95c143005a862223e9bf)
-rw-r--r--opengl/include/EGL/eglext.h5
-rw-r--r--opengl/libs/EGL/eglApi.cpp6
2 files changed, 11 insertions, 0 deletions
diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h
index 7de8c62e2f..bb28600da3 100644
--- a/opengl/include/EGL/eglext.h
+++ b/opengl/include/EGL/eglext.h
@@ -682,6 +682,11 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETFRAMETIMESTAMPSUPPORTEDANDROID) (EGLDi
#define EGL_GL_COLORSPACE_DISPLAY_P3_LINEAR_EXT 0x3362
#endif /* EGL_EXT_gl_colorspace_display_p3_linear */
+#ifndef EGL_EXT_gl_colorspace_scrgb
+#define EGL_EXT_gl_colorspace_scrgb 1
+#define EGL_GL_COLORSPACE_SCRGB_EXT 0x3351
+#endif /* EGL_EXT_gl_colorspace_scrgb */
+
#ifndef EGL_EXT_gl_colorspace_scrgb_linear
#define EGL_EXT_gl_colorspace_scrgb_linear 1
#define EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT 0x3350
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index c5feb89848..2fa36faf53 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -87,6 +87,7 @@ char const * const gBuiltinExtensionString =
"EGL_ANDROID_get_native_client_buffer "
"EGL_ANDROID_front_buffer_auto_refresh "
"EGL_ANDROID_get_frame_timestamps "
+ "EGL_EXT_gl_colorspace_scrgb "
"EGL_EXT_gl_colorspace_scrgb_linear "
"EGL_EXT_gl_colorspace_display_p3_linear "
"EGL_EXT_gl_colorspace_display_p3 "
@@ -467,6 +468,8 @@ static android_dataspace modifyBufferDataspace(android_dataspace dataSpace,
return HAL_DATASPACE_DISPLAY_P3;
} else if (colorspace == EGL_GL_COLORSPACE_DISPLAY_P3_LINEAR_EXT) {
return HAL_DATASPACE_DISPLAY_P3_LINEAR;
+ } else if (colorspace == EGL_GL_COLORSPACE_SCRGB_EXT) {
+ return HAL_DATASPACE_V0_SCRGB;
} else if (colorspace == EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT) {
return HAL_DATASPACE_V0_SCRGB_LINEAR;
}
@@ -545,6 +548,9 @@ static EGLBoolean getColorSpaceAttribute(egl_display_ptr dp, const EGLint* attri
} else if (colorSpace == EGL_EXT_gl_colorspace_bt2020_pq &&
dp->haveExtension("EGL_EXT_gl_colorspace_bt2020_pq")) {
found = true;
+ } else if (colorSpace == EGL_GL_COLORSPACE_SCRGB_EXT &&
+ dp->haveExtension("EGL_EXT_gl_colorspace_scrgb")) {
+ found = true;
} else if (colorSpace == EGL_GL_COLORSPACE_SCRGB_LINEAR_EXT &&
dp->haveExtension("EGL_EXT_gl_colorspace_scrgb_linear")) {
found = true;