Loading core/java/android/view/SurfaceControl.java +20 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,8 @@ public final class SurfaceControl implements Parcelable { long nativeObject, float clientDrawnCornerRadius); private static native void nativeSetBackgroundBlurRadius(long transactionObj, long nativeObject, int blurRadius); private static native void nativeSetBackgroundBlurScale(long transactionObj, long nativeObject, float blurScale); private static native void nativeSetLayerStack(long transactionObj, long nativeObject, int layerStack); private static native void nativeSetBlurRegions(long transactionObj, long nativeObj, Loading Loading @@ -3811,6 +3813,24 @@ public final class SurfaceControl implements Parcelable { return this; } /** * Sets the background blur scaling of the {@link SurfaceControl}. * * @param sc SurfaceControl. * @param scale Zoom level to apply, where 1.0f is 100%. * @return itself. * @hide */ public Transaction setBackgroundBlurScale(SurfaceControl sc, float scale) { checkPreconditions(sc); if (SurfaceControlRegistry.sCallStackDebuggingEnabled) { SurfaceControlRegistry.getProcessInstance().checkCallStackDebugging( "setBackgroundBlurScale", this, sc, "scale=" + scale); } nativeSetBackgroundBlurScale(mNativeObject, sc.mNativeObject, scale); return this; } /** * Specify what regions should be blurred on the {@link SurfaceControl}. * Loading core/jni/android_view_SurfaceControl.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -1131,6 +1131,14 @@ static void nativeSetBackgroundBlurRadius(JNIEnv* env, jclass clazz, jlong trans transaction->setBackgroundBlurRadius(ctrl, blurRadius); } static void nativeSetBackgroundBlurScale(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jfloat blurScale) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); transaction->setBackgroundBlurScale(ctrl, blurScale); } static void nativeSetLayerStack(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jint layerStack) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); Loading Loading @@ -2606,6 +2614,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*) nativeSetClientDrawnCornerRadius }, {"nativeSetBackgroundBlurRadius", "(JJI)V", (void*)nativeSetBackgroundBlurRadius }, {"nativeSetBackgroundBlurScale", "(JJF)V", (void*)nativeSetBackgroundBlurScale }, {"nativeSetLayerStack", "(JJI)V", (void*)nativeSetLayerStack }, {"nativeSetBlurRegions", "(JJ[[FI)V", Loading Loading
core/java/android/view/SurfaceControl.java +20 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,8 @@ public final class SurfaceControl implements Parcelable { long nativeObject, float clientDrawnCornerRadius); private static native void nativeSetBackgroundBlurRadius(long transactionObj, long nativeObject, int blurRadius); private static native void nativeSetBackgroundBlurScale(long transactionObj, long nativeObject, float blurScale); private static native void nativeSetLayerStack(long transactionObj, long nativeObject, int layerStack); private static native void nativeSetBlurRegions(long transactionObj, long nativeObj, Loading Loading @@ -3811,6 +3813,24 @@ public final class SurfaceControl implements Parcelable { return this; } /** * Sets the background blur scaling of the {@link SurfaceControl}. * * @param sc SurfaceControl. * @param scale Zoom level to apply, where 1.0f is 100%. * @return itself. * @hide */ public Transaction setBackgroundBlurScale(SurfaceControl sc, float scale) { checkPreconditions(sc); if (SurfaceControlRegistry.sCallStackDebuggingEnabled) { SurfaceControlRegistry.getProcessInstance().checkCallStackDebugging( "setBackgroundBlurScale", this, sc, "scale=" + scale); } nativeSetBackgroundBlurScale(mNativeObject, sc.mNativeObject, scale); return this; } /** * Specify what regions should be blurred on the {@link SurfaceControl}. * Loading
core/jni/android_view_SurfaceControl.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -1131,6 +1131,14 @@ static void nativeSetBackgroundBlurRadius(JNIEnv* env, jclass clazz, jlong trans transaction->setBackgroundBlurRadius(ctrl, blurRadius); } static void nativeSetBackgroundBlurScale(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jfloat blurScale) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject); transaction->setBackgroundBlurScale(ctrl, blurScale); } static void nativeSetLayerStack(JNIEnv* env, jclass clazz, jlong transactionObj, jlong nativeObject, jint layerStack) { auto transaction = reinterpret_cast<SurfaceComposerClient::Transaction*>(transactionObj); Loading Loading @@ -2606,6 +2614,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*) nativeSetClientDrawnCornerRadius }, {"nativeSetBackgroundBlurRadius", "(JJI)V", (void*)nativeSetBackgroundBlurRadius }, {"nativeSetBackgroundBlurScale", "(JJF)V", (void*)nativeSetBackgroundBlurScale }, {"nativeSetLayerStack", "(JJI)V", (void*)nativeSetLayerStack }, {"nativeSetBlurRegions", "(JJ[[FI)V", Loading