diff options
| -rw-r--r-- | graphics/java/android/graphics/drawable/GradientDrawable.java | 8 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index f5a6f4910b1b..8b5114c50581 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -825,6 +825,14 @@ public class GradientDrawable extends Drawable { mFillPaint.setXfermode(mode); } + /** + * @param aa to draw this drawable with + * @hide + */ + public void setAntiAlias(boolean aa) { + mFillPaint.setAntiAlias(aa); + } + private void buildPathIfDirty() { final GradientState st = mGradientState; if (mPathIsDirty) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java index d6beb7fb2699..ab89a5287cdb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationBackgroundView.java @@ -249,6 +249,9 @@ public class NotificationBackgroundView extends View { (GradientDrawable) ((LayerDrawable) mBackground).getDrawable(0); gradientDrawable.setXfermode( running ? new PorterDuffXfermode(PorterDuff.Mode.SRC) : null); + // Speed optimization: disable AA if transfer mode is not SRC_OVER. AA is not easy to + // spot during animation anyways. + gradientDrawable.setAntiAlias(!running); } if (!mExpandAnimationRunning) { setDrawableAlpha(mDrawableAlpha); |