From 27acc69966014cf22f281a237cf7e721ab01a7fc Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Wed, 19 May 2021 14:00:50 +0100 Subject: [PATCH] Fixing jagged corners of the notification scrim Notification scrim needs to start being drawn horizontally at -1 and end at screen_width+1 to expand horizontally and cover jagged corners caused by clipping out path which can't be anti-aliased Fixes: 186644628 Test: manual Change-Id: I776671eb32213b3023287e87d971536f716960b7 --- .../android/systemui/statusbar/phone/ScrimController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 7c63763b43c3b..4232ee4292e29 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -548,8 +548,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump */ public void setNotificationsBounds(float left, float top, float right, float bottom) { if (mClipsQsScrim) { - // "top - 1" to have 1 px of scrims overlap, see: b/186644628 - mNotificationsScrim.setDrawableBounds(left, top - 1, right, bottom); + // notification scrim's rounded corners are anti-aliased, but clipping of the QS scrim + // can't be and it's causing jagged corners. That's why notification scrim needs + // to overlap QS scrim by one pixel - both vertically (top - 1) and + // horizontally (left - 1 and right + 1), see: b/186644628 + mNotificationsScrim.setDrawableBounds(left - 1, top - 1, right + 1, bottom); mScrimBehind.setBottomEdgePosition((int) top); } else { mNotificationsScrim.setDrawableBounds(left, top, right, bottom);