Merge "Reduce amount of unnecessary RippleDrawable mask redraw" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2b184e8634
@@ -237,7 +237,7 @@ abstract class RippleComponent {
|
||||
}
|
||||
|
||||
protected final void invalidateSelf() {
|
||||
mOwner.invalidateSelf();
|
||||
mOwner.invalidateSelf(false);
|
||||
}
|
||||
|
||||
protected final boolean isHardwareAnimating() {
|
||||
|
||||
@@ -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,10 +684,17 @@ public class RippleDrawable extends LayerDrawable {
|
||||
|
||||
@Override
|
||||
public void invalidateSelf() {
|
||||
invalidateSelf(true);
|
||||
}
|
||||
|
||||
void invalidateSelf(boolean invalidateMask) {
|
||||
super.invalidateSelf();
|
||||
|
||||
// Force the mask to update on the next draw().
|
||||
mHasValidMask = false;
|
||||
if (invalidateMask) {
|
||||
// Force the mask to update on the next draw().
|
||||
mHasValidMask = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void pruneRipples() {
|
||||
|
||||
Reference in New Issue
Block a user