OSDN Git Service

EGL: Add EGL_GL_scrgb extension
authorCourtney Goeltzenleuchter <courtneygo@google.com>
Fri, 23 Jun 2017 15:06:52 +0000 (09:06 -0600)
committerCourtney Goeltzenleuchter <courtneygo@google.com>
Tue, 1 Aug 2017 16:51:43 +0000 (10:51 -0600)
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)

opengl/include/EGL/eglext.h
opengl/libs/EGL/eglApi.cpp

index 7de8c62..bb28600 100644 (file)
@@ -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
index c5feb89..2fa36fa 100644 (file)
@@ -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;