Merge "Turn off AA while notification expanding animation is running"

This commit is contained in:
TreeHugger Robot
2018-02-07 22:31:54 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 0 deletions

View File

@@ -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) {

View File

@@ -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);