diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/SurfaceControl.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index 46f396a0b66b..ab010855b896 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -104,6 +104,8 @@ public class SurfaceControl implements Parcelable { int flags, int mask); private static native void nativeSetWindowCrop(long transactionObj, long nativeObject, int l, int t, int r, int b); + private static native void nativeSetCornerRadius(long transactionObj, long nativeObject, + float cornerRadius); private static native void nativeSetLayerStack(long transactionObj, long nativeObject, int layerStack); @@ -1006,6 +1008,18 @@ public class SurfaceControl implements Parcelable { } } + /** + * Sets the corner radius of a {@link SurfaceControl}. + * + * @param cornerRadius Corner radius in pixels. + */ + public void setCornerRadius(float cornerRadius) { + checkNotReleased(); + synchronized (SurfaceControl.class) { + sGlobalTransaction.setCornerRadius(this, cornerRadius); + } + } + public void setLayerStack(int layerStack) { checkNotReleased(); synchronized(SurfaceControl.class) { @@ -1529,6 +1543,20 @@ public class SurfaceControl implements Parcelable { return this; } + /** + * Sets the corner radius of a {@link SurfaceControl}. + * @param sc SurfaceControl + * @param cornerRadius Corner radius in pixels. + * @return Itself. + */ + @UnsupportedAppUsage + public Transaction setCornerRadius(SurfaceControl sc, float cornerRadius) { + sc.checkNotReleased(); + nativeSetCornerRadius(mNativeObject, sc.mNativeObject, cornerRadius); + + return this; + } + @UnsupportedAppUsage public Transaction setLayerStack(SurfaceControl sc, int layerStack) { sc.checkNotReleased(); |
