Revert "Avoid drawable invalidation during draw()"

This reverts commit e5e59c6da4.

Drawables expect to be able to call invalidateSelf() during
draw() to pump animation frames. We shouldn't break this.

Bug: 26533725
Change-Id: Ibe2871f2622faf836637225fc1e3e6f0ca6def47
This commit is contained in:
Alan Viverette
2016-01-13 21:49:10 +00:00
parent e5e59c6da4
commit 156bd49bdc

View File

@@ -3481,9 +3481,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
private int[] mDrawableState = null;
/** Whether draw() is currently being called. */
private boolean mInDraw = false;
ViewOutlineProvider mOutlineProvider = ViewOutlineProvider.BACKGROUND;
/**
@@ -16154,8 +16151,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
@CallSuper
public void draw(Canvas canvas) {
mInDraw = true;
final int privateFlags = mPrivateFlags;
final boolean dirtyOpaque = (privateFlags & PFLAG_DIRTY_MASK) == PFLAG_DIRTY_OPAQUE &&
(mAttachInfo == null || !mAttachInfo.mIgnoreDirtyState);
@@ -16200,7 +16195,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
onDrawForeground(canvas);
// we're done...
mInDraw = false;
return;
}
@@ -16348,8 +16342,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// Step 6, draw decorations (foreground, scrollbars)
onDrawForeground(canvas);
mInDraw = false;
}
/**
@@ -16794,8 +16786,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
@Override
public void invalidateDrawable(@NonNull Drawable drawable) {
// Don't invalidate if a drawable changes during drawing.
if (verifyDrawable(drawable) && !mInDraw) {
if (verifyDrawable(drawable)) {
final Rect dirty = drawable.getDirtyBounds();
final int scrollX = mScrollX;
final int scrollY = mScrollY;