Loading core/java/android/view/SurfaceControl.java +27 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,8 @@ public final class SurfaceControl implements Parcelable { float dtdy, float dsdy); private static native void nativeSetColorTransform(long transactionObj, long nativeObject, float[] matrix, float[] translation); private static native void nativeSetColorSpaceAgnostic(long transactionObj, long nativeObject, boolean agnostic); private static native void nativeSetGeometry(long transactionObj, long nativeObject, Rect sourceCrop, Rect dest, long orientation); private static native void nativeSetColor(long transactionObj, long nativeObject, float[] color); Loading Loading @@ -1206,6 +1208,19 @@ public final class SurfaceControl implements Parcelable { } } /** * Sets the Surface to be color space agnostic. If a surface is color space agnostic, * the color can be interpreted in any color space. * @param agnostic A boolean to indicate whether the surface is color space agnostic * @hide */ public void setColorSpaceAgnostic(boolean agnostic) { checkNotReleased(); synchronized (SurfaceControl.class) { sGlobalTransaction.setColorSpaceAgnostic(this, agnostic); } } /** * Bounds the surface and its children to the bounds specified. Size of the surface will be * ignored and only the crop and buffer size will be used to determine the bounds of the Loading Loading @@ -2226,6 +2241,18 @@ public final class SurfaceControl implements Parcelable { return this; } /** * Sets the Surface to be color space agnostic. If a surface is color space agnostic, * the color can be interpreted in any color space. * @param agnostic A boolean to indicate whether the surface is color space agnostic * @hide */ public Transaction setColorSpaceAgnostic(SurfaceControl sc, boolean agnostic) { sc.checkNotReleased(); nativeSetColorSpaceAgnostic(mNativeObject, sc.mNativeObject, agnostic); return this; } /** * @hide */ Loading core/jni/android_view_SurfaceControl.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -463,6 +463,13 @@ static void nativeSetColorTransform(JNIEnv* env, jclass clazz, jlong transaction transaction->setColorTransform(surfaceControl, matrix, translation); } static void nativeSetColorSpaceAgnostic(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jboolean agnostic) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); SurfaceControl* const surfaceControl = reinterpret_cast<SurfaceControl*>(nativeObject); transaction->setColorSpaceAgnostic(surfaceControl, agnostic); } static void nativeSetWindowCrop(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jint l, jint t, jint r, jint b) { Loading Loading @@ -1206,6 +1213,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSetMatrix }, {"nativeSetColorTransform", "(JJ[F[F)V", (void*)nativeSetColorTransform }, {"nativeSetColorSpaceAgnostic", "(JJZ)V", (void*)nativeSetColorSpaceAgnostic }, {"nativeSetFlags", "(JJII)V", (void*)nativeSetFlags }, {"nativeSetWindowCrop", "(JJIIII)V", Loading services/core/java/com/android/server/wm/Letterbox.java +1 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,7 @@ public class Letterbox { .setFlags(HIDDEN).setColorLayer().build(); mSurface.setLayer(-1); mSurface.setColor(new float[]{0, 0, 0}); mSurface.setColorSpaceAgnostic(true); } void attachInput(WindowState win) { Loading Loading
core/java/android/view/SurfaceControl.java +27 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,8 @@ public final class SurfaceControl implements Parcelable { float dtdy, float dsdy); private static native void nativeSetColorTransform(long transactionObj, long nativeObject, float[] matrix, float[] translation); private static native void nativeSetColorSpaceAgnostic(long transactionObj, long nativeObject, boolean agnostic); private static native void nativeSetGeometry(long transactionObj, long nativeObject, Rect sourceCrop, Rect dest, long orientation); private static native void nativeSetColor(long transactionObj, long nativeObject, float[] color); Loading Loading @@ -1206,6 +1208,19 @@ public final class SurfaceControl implements Parcelable { } } /** * Sets the Surface to be color space agnostic. If a surface is color space agnostic, * the color can be interpreted in any color space. * @param agnostic A boolean to indicate whether the surface is color space agnostic * @hide */ public void setColorSpaceAgnostic(boolean agnostic) { checkNotReleased(); synchronized (SurfaceControl.class) { sGlobalTransaction.setColorSpaceAgnostic(this, agnostic); } } /** * Bounds the surface and its children to the bounds specified. Size of the surface will be * ignored and only the crop and buffer size will be used to determine the bounds of the Loading Loading @@ -2226,6 +2241,18 @@ public final class SurfaceControl implements Parcelable { return this; } /** * Sets the Surface to be color space agnostic. If a surface is color space agnostic, * the color can be interpreted in any color space. * @param agnostic A boolean to indicate whether the surface is color space agnostic * @hide */ public Transaction setColorSpaceAgnostic(SurfaceControl sc, boolean agnostic) { sc.checkNotReleased(); nativeSetColorSpaceAgnostic(mNativeObject, sc.mNativeObject, agnostic); return this; } /** * @hide */ Loading
core/jni/android_view_SurfaceControl.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -463,6 +463,13 @@ static void nativeSetColorTransform(JNIEnv* env, jclass clazz, jlong transaction transaction->setColorTransform(surfaceControl, matrix, translation); } static void nativeSetColorSpaceAgnostic(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jboolean agnostic) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); SurfaceControl* const surfaceControl = reinterpret_cast<SurfaceControl*>(nativeObject); transaction->setColorSpaceAgnostic(surfaceControl, agnostic); } static void nativeSetWindowCrop(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jint l, jint t, jint r, jint b) { Loading Loading @@ -1206,6 +1213,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*)nativeSetMatrix }, {"nativeSetColorTransform", "(JJ[F[F)V", (void*)nativeSetColorTransform }, {"nativeSetColorSpaceAgnostic", "(JJZ)V", (void*)nativeSetColorSpaceAgnostic }, {"nativeSetFlags", "(JJII)V", (void*)nativeSetFlags }, {"nativeSetWindowCrop", "(JJIIII)V", Loading
services/core/java/com/android/server/wm/Letterbox.java +1 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,7 @@ public class Letterbox { .setFlags(HIDDEN).setColorLayer().build(); mSurface.setLayer(-1); mSurface.setColor(new float[]{0, 0, 0}); mSurface.setColorSpaceAgnostic(true); } void attachInput(WindowState win) { Loading