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

Commit ff25528a authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Do not invalidate drawable if tint doesn't change" into nyc-dev

parents 3552418f 7cd1f0d3
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -641,17 +641,23 @@ public class BitmapDrawable extends Drawable {

    @Override
    public void setTintList(ColorStateList tint) {
        mBitmapState.mTint = tint;
        final BitmapState state = mBitmapState;
        if (state.mTint != tint) {
            state.mTint = tint;
            mTintFilter = updateTintFilter(mTintFilter, tint, mBitmapState.mTintMode);
            invalidateSelf();
        }
    }

    @Override
    public void setTintMode(PorterDuff.Mode tintMode) {
        mBitmapState.mTintMode = tintMode;
        final BitmapState state = mBitmapState;
        if (state.mTintMode != tintMode) {
            state.mTintMode = tintMode;
            mTintFilter = updateTintFilter(mTintFilter, mBitmapState.mTint, tintMode);
            invalidateSelf();
        }
    }

    /**
     * @hide only needed by a hack within ProgressBar