Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d192911e authored by Stan Iliev's avatar Stan Iliev
Browse files

Turn off AA while notification expanding animation is running

Turn off AA from GriadientDrawable, while drawing with SRC
transfer mode. This CL speeds up drawing by avoiding intermediate
texture buffer in skia.

Bug:72804165
Test: Measured performance with systrace on opening a notifiation.
Change-Id: Icc69de90d81e8b1c4492f97722f72e7440d9acac
parent 0ab4ea3e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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) {
+3 −0
Original line number Diff line number Diff line
@@ -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);