summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorDaniel Solomon <solomondaniel@google.com>2019-01-31 18:28:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-01-31 18:28:56 +0000
commitb39aaa494bd6f0dae88fc7fa7f52bee7b89bda9b (patch)
tree19ee2c5793483e846791eb018535b3168dfc3d7e /core/java
parent00c67e08d4d5ec704512251ae407e569fd7a16aa (diff)
parent10e3b336bd16c5efec654de4b7d480d27b50f219 (diff)
Merge "SurfaceControl: Add a hidden API to get display color primaries"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/SurfaceControl.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 6e76647f4b96..8061cc3bab74 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -155,6 +155,8 @@ public final class SurfaceControl implements Parcelable {
private static native int nativeGetActiveConfig(IBinder displayToken);
private static native boolean nativeSetActiveConfig(IBinder displayToken, int id);
private static native int[] nativeGetDisplayColorModes(IBinder displayToken);
+ private static native SurfaceControl.DisplayPrimaries nativeGetDisplayNativePrimaries(
+ IBinder displayToken);
private static native int[] nativeGetCompositionDataspaces();
private static native int nativeGetActiveColorMode(IBinder displayToken);
private static native boolean nativeSetActiveColorMode(IBinder displayToken,
@@ -1536,6 +1538,73 @@ public final class SurfaceControl implements Parcelable {
}
/**
+ * Color coordinates in CIE1931 XYZ color space
+ *
+ * @hide
+ */
+ public static final class CieXyz {
+ /**
+ * @hide
+ */
+ public float X;
+
+ /**
+ * @hide
+ */
+ public float Y;
+
+ /**
+ * @hide
+ */
+ public float Z;
+ }
+
+ /**
+ * Contains a display's color primaries
+ *
+ * @hide
+ */
+ public static final class DisplayPrimaries {
+ /**
+ * @hide
+ */
+ public CieXyz red;
+
+ /**
+ * @hide
+ */
+ public CieXyz green;
+
+ /**
+ * @hide
+ */
+ public CieXyz blue;
+
+ /**
+ * @hide
+ */
+ public CieXyz white;
+
+ /**
+ * @hide
+ */
+ public DisplayPrimaries() {
+ }
+ }
+
+ /**
+ * @hide
+ */
+ public static SurfaceControl.DisplayPrimaries getDisplayNativePrimaries(
+ IBinder displayToken) {
+ if (displayToken == null) {
+ throw new IllegalArgumentException("displayToken must not be null");
+ }
+
+ return nativeGetDisplayNativePrimaries(displayToken);
+ }
+
+ /**
* @hide
*/
public static int getActiveColorMode(IBinder displayToken) {