summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2016-01-14 16:06:36 -0500
committerAlan Viverette <alanv@google.com>2016-01-14 21:07:13 +0000
commita53c3b2197b73d5b6a697ae2077e04065df84d9e (patch)
tree73b1a673dfab10c5e923fbb914fb885e1bc56283
parente41a6c8b19482a05a98e77d13281f7f14056f119 (diff)
downloadframeworks_base-a53c3b2197b73d5b6a697ae2077e04065df84d9e.zip
frameworks_base-a53c3b2197b73d5b6a697ae2077e04065df84d9e.tar.gz
frameworks_base-a53c3b2197b73d5b6a697ae2077e04065df84d9e.tar.bz2
Don't verify the scrollbar drawable
Avoids infinite invalidations caused by re-use of scrollbar drawable during a single draw() pass. Does not address the general problem of drawable reuse causing unnecessary invalidations as a result of calls to setBounds() invoking invalidateSelf(). Bug: 26533725 Change-Id: I99e9c2dfe4ddfc833569e40e7268dcb03e931fc9
-rw-r--r--core/java/android/view/View.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index dea004e..720d9a8 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -16937,8 +16937,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
@CallSuper
protected boolean verifyDrawable(Drawable who) {
- return who == mBackground || (mScrollCache != null && mScrollCache.scrollBar == who)
- || (mForegroundInfo != null && mForegroundInfo.mDrawable == who);
+ // Avoid verifying the scroll bar drawable so that we don't end up in
+ // an invalidation loop. This effectively prevents the scroll bar
+ // drawable from triggering invalidations and scheduling runnables.
+ return who == mBackground || (mForegroundInfo != null && mForegroundInfo.mDrawable == who);
}
/**