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

am: ff25528a9b

* commit 'ff25528a9beaa33a4effbe90c3d3fc259c0d3aa8':
  Do not invalidate drawable if tint doesn't change
This commit is contained in:
Jorim Jaggi
2016-02-10 06:23:13 +00:00
committed by android-build-merger

View File

@@ -641,17 +641,23 @@ public class BitmapDrawable extends Drawable {
@Override @Override
public void setTintList(ColorStateList tint) { 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); mTintFilter = updateTintFilter(mTintFilter, tint, mBitmapState.mTintMode);
invalidateSelf(); invalidateSelf();
} }
}
@Override @Override
public void setTintMode(PorterDuff.Mode tintMode) { 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); mTintFilter = updateTintFilter(mTintFilter, mBitmapState.mTint, tintMode);
invalidateSelf(); invalidateSelf();
} }
}
/** /**
* @hide only needed by a hack within ProgressBar * @hide only needed by a hack within ProgressBar