Add HDR dataspaces to EGL
bug: 63710530
Test: adb shell /data/nativetest/EGL_test/EGL_test
Test: adb -d shell am start -n \
com.drawelements.deqp/android.app.NativeActivity \
-e cmdLine '"deqp --deqp-case=dEQP-EGL.functional.hdr_color.* \
--deqp-log-filename=/sdcard/dEQP-Log.qpa"'
Change-Id: I52c43539806c901c674f037489d502d771080a30
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp
index 3c1edd1..0f36614 100644
--- a/opengl/libs/EGL/egl_display.cpp
+++ b/opengl/libs/EGL/egl_display.cpp
@@ -214,6 +214,23 @@
"EGL_EXT_gl_colorspace_display_p3_linear EGL_EXT_gl_colorspace_display_p3 ");
}
+ bool hasHdrBoardConfig =
+ getBool<ISurfaceFlingerConfigs, &ISurfaceFlingerConfigs::hasHDRDisplay>(false);
+
+ if (hasHdrBoardConfig) {
+ // hasHDRBoardConfig indicates the system is capable of supporting HDR content.
+ // Typically that means there is an HDR capable display attached, but could be
+ // support for attaching an HDR display. In either case, advertise support for
+ // HDR color spaces.
+ mExtensionString.append(
+ "EGL_EXT_gl_colorspace_bt2020_linear EGL_EXT_gl_colorspace_bt2020_pq ");
+ }
+
+ // Always advertise HDR metadata extensions since it's okay for an application
+ // to specify such information even though it may not be used by the system.
+ mExtensionString.append(
+ "EGL_EXT_surface_SMPTE2086_metadata EGL_EXT_surface_CTA861_3_metadata ");
+
char const* start = gExtensionString;
do {
// length of the extension name