summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/SurfaceControl.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 7271a9e4616f..0d33bbd1fc76 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -97,6 +97,8 @@ public class SurfaceControl implements Parcelable {
private static native void nativeSetMatrix(long transactionObj, long nativeObject,
float dsdx, float dtdx,
float dtdy, float dsdy);
+ private static native void nativeSetColorTransform(long transactionObj, long nativeObject,
+ float[] matrix, float[] translation);
private static native void nativeSetColor(long transactionObj, long nativeObject, float[] color);
private static native void nativeSetFlags(long transactionObj, long nativeObject,
int flags, int mask);
@@ -945,6 +947,18 @@ public class SurfaceControl implements Parcelable {
}
}
+ /**
+ * Sets the color transform for the Surface.
+ * @param matrix A float array with 9 values represents a 3x3 transform matrix
+ * @param translation A float array with 3 values represents a translation vector
+ */
+ public void setColorTransform(@Size(9) float[] matrix, @Size(3) float[] translation) {
+ checkNotReleased();
+ synchronized (SurfaceControl.class) {
+ sGlobalTransaction.setColorTransform(this, matrix, translation);
+ }
+ }
+
public void setWindowCrop(Rect crop) {
checkNotReleased();
synchronized (SurfaceControl.class) {
@@ -1438,6 +1452,18 @@ public class SurfaceControl implements Parcelable {
return this;
}
+ /**
+ * Sets the color transform for the Surface.
+ * @param matrix A float array with 9 values represents a 3x3 transform matrix
+ * @param translation A float array with 3 values represents a translation vector
+ */
+ public Transaction setColorTransform(SurfaceControl sc, @Size(9) float[] matrix,
+ @Size(3) float[] translation) {
+ sc.checkNotReleased();
+ nativeSetColorTransform(mNativeObject, sc.mNativeObject, matrix, translation);
+ return this;
+ }
+
@UnsupportedAppUsage
public Transaction setWindowCrop(SurfaceControl sc, Rect crop) {
sc.checkNotReleased();