From 33c1ea73e869e68b793ae9a21c2d8ea41e9f1c9a Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Mon, 27 Sep 2021 20:56:08 +0000 Subject: Enable path clipping for View outlines Clipping Views to Outlines has existed for several releases, as has providing a Path for shaping Oulines. However, using a Path-shaped Outline to clip a View against was specifically disabled internally, due to historical functionality limitations (prior to enabling Skia for HWUI rendering) as well as performance concerns. On current (even relatively low-end) hardware, path clipping is now sufficiently performant that we are enabling this functionality. This functionality will be used by AndroidX APIs that enable easier shaping via paths. Bug: 201807515 Test: Manual testing including hwui performance tests and CTS OutlineTest Change-Id: Ic61d9393cb72c6ad3517954177e5037a383a0c4d --- graphics/java/android/graphics/Outline.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/java/android') diff --git a/graphics/java/android/graphics/Outline.java b/graphics/java/android/graphics/Outline.java index b77865f423c6..fc7f84c3c83e 100644 --- a/graphics/java/android/graphics/Outline.java +++ b/graphics/java/android/graphics/Outline.java @@ -118,13 +118,13 @@ public final class Outline { /** * Returns whether the outline can be used to clip a View. *

- * Currently, only Outlines that can be represented as a rectangle, circle, - * or round rect support clipping. + * As of API 33, all Outline shapes support clipping. Prior to API 33, only Outlines that + * could be represented as a rectangle, circle, or round rect supported clipping. * * @see android.view.View#setClipToOutline(boolean) */ public boolean canClip() { - return mMode != MODE_PATH; + return true; } /** -- cgit v1.2.3-59-g8ed1b