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

Commit 2b184e86 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Reduce amount of unnecessary RippleDrawable mask redraw" into mnc-dev

parents 765389ec 15ce834e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ abstract class RippleComponent {
    }

    protected final void invalidateSelf() {
        mOwner.invalidateSelf();
        mOwner.invalidateSelf(false);
    }

    protected final boolean isHardwareAnimating() {
+13 −6
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ public class RippleDrawable extends LayerDrawable {
        mExitingRipplesCount = 0;

        // Always draw an additional "clean" frame after canceling animations.
        invalidateSelf();
        invalidateSelf(false);
    }

    @Override
@@ -364,7 +364,7 @@ public class RippleDrawable extends LayerDrawable {
     */
    public void setColor(ColorStateList color) {
        mState.mColor = color;
        invalidateSelf();
        invalidateSelf(false);
    }

    /**
@@ -376,7 +376,7 @@ public class RippleDrawable extends LayerDrawable {
     */
    public void setRadius(int radius) {
        mState.mMaxRadius = radius;
        invalidateSelf();
        invalidateSelf(false);
    }

    /**
@@ -477,7 +477,7 @@ public class RippleDrawable extends LayerDrawable {
    private void setTargetDensity(DisplayMetrics metrics) {
        if (mDensity != metrics.density) {
            mDensity = metrics.density;
            invalidateSelf();
            invalidateSelf(false);
        }
    }

@@ -684,12 +684,19 @@ public class RippleDrawable extends LayerDrawable {

    @Override
    public void invalidateSelf() {
        invalidateSelf(true);
    }

    void invalidateSelf(boolean invalidateMask) {
        super.invalidateSelf();

        if (invalidateMask) {
            // Force the mask to update on the next draw().
            mHasValidMask = false;
        }

    }

    private void pruneRipples() {
        int remaining = 0;