diff options
| author | Chavi Weingarten <chaviw@google.com> | 2021-04-16 00:30:11 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-04-16 00:30:11 +0000 |
| commit | d6ea380f13f73c44d7431ca0fa6dc82929348e6e (patch) | |
| tree | cb0993610abf7d9b026a9b20cb5b86e7068905f6 /core/java/android/view/SurfaceControl.java | |
| parent | 97bf5c62e1e066f07394028dd1e51465ebf1087b (diff) | |
| parent | 0bfc89b9fedf376fb6a761e984b26d38fc7118ee (diff) | |
Merge "Use BLAST layer for screen rotation, surface freezer, and organizer" into sc-dev
Diffstat (limited to 'core/java/android/view/SurfaceControl.java')
| -rw-r--r-- | core/java/android/view/SurfaceControl.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 21f75d419a5e..2c81e8986ac6 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -35,6 +35,7 @@ import android.annotation.TestApi; import android.compat.annotation.UnsupportedAppUsage; import android.graphics.Bitmap; import android.graphics.ColorSpace; +import android.graphics.GraphicBuffer; import android.graphics.Matrix; import android.graphics.PixelFormat; import android.graphics.Point; @@ -188,6 +189,10 @@ public final class SurfaceControl implements Parcelable { IBinder displayToken, int mode); private static native void nativeReparent(long transactionObj, long nativeObject, long newParentNativeObject); + private static native void nativeSetBuffer(long transactionObj, long nativeObject, + GraphicBuffer buffer); + private static native void nativeSetColorSpace(long transactionObj, long nativeObject, + int colorSpace); private static native void nativeOverrideHdrTypes(IBinder displayToken, int[] modes); @@ -3362,6 +3367,31 @@ public final class SurfaceControl implements Parcelable { return this; } + /** + * Set a buffer for a SurfaceControl. This can only be used for SurfaceControls that were + * created as type {@link #FX_SURFACE_BLAST} + * + * @hide + */ + public Transaction setBuffer(SurfaceControl sc, GraphicBuffer buffer) { + checkPreconditions(sc); + nativeSetBuffer(mNativeObject, sc.mNativeObject, buffer); + return this; + } + + /** + * Set the color space for the SurfaceControl. The supported color spaces are SRGB + * and Display P3, other color spaces will be treated as SRGB. This can only be used for + * SurfaceControls that were created as type {@link #FX_SURFACE_BLAST} + * + * @hide + */ + public Transaction setColorSpace(SurfaceControl sc, ColorSpace colorSpace) { + checkPreconditions(sc); + nativeSetColorSpace(mNativeObject, sc.mNativeObject, colorSpace.getId()); + return this; + } + /** * Merge the other transaction into this transaction, clearing the * other transaction as if it had been applied. |
