diff options
author | Chet Haase <chet@google.com> | 2011-07-19 07:21:03 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-19 07:21:03 -0700 |
commit | 7dde1c8ccce049378b8aa9e757b6f907040c8640 (patch) | |
tree | d838c3e9563ab90e21b1df49dfb050a9155ea245 /core/java/android | |
parent | 35be3dee17fed3036ad40b9dd2ea3ee7504b3dc3 (diff) | |
parent | 75755e23f30d7a1f8c7b0c76ff5b2bcc72d6844f (diff) | |
download | frameworks_base-7dde1c8ccce049378b8aa9e757b6f907040c8640.zip frameworks_base-7dde1c8ccce049378b8aa9e757b6f907040c8640.tar.gz frameworks_base-7dde1c8ccce049378b8aa9e757b6f907040c8640.tar.bz2 |
Merge "Don't recreate view's display list when size hasn't changed"
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/view/View.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 4e9c0b7..59cb216 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -10756,12 +10756,14 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit // Remember our drawn bit int drawn = mPrivateFlags & DRAWN; - // Invalidate our old position - invalidate(true); - - int oldWidth = mRight - mLeft; int oldHeight = mBottom - mTop; + int newWidth = right - left; + int newHeight = bottom - top; + boolean sizeChanged = (newWidth != oldWidth) || (newHeight != oldHeight); + + // Invalidate our old position + invalidate(sizeChanged); mLeft = left; mTop = top; @@ -10770,10 +10772,8 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit mPrivateFlags |= HAS_BOUNDS; - int newWidth = right - left; - int newHeight = bottom - top; - if (newWidth != oldWidth || newHeight != oldHeight) { + if (sizeChanged) { if ((mPrivateFlags & PIVOT_EXPLICITLY_SET) == 0) { // A change in dimension means an auto-centered pivot point changes, too mMatrixDirty = true; @@ -10788,7 +10788,7 @@ public class View implements Drawable.Callback2, KeyEvent.Callback, Accessibilit // before this call to setFrame came in, thereby clearing // the DRAWN bit. mPrivateFlags |= DRAWN; - invalidate(true); + invalidate(sizeChanged); // parent display list may need to be recreated based on a change in the bounds // of any child invalidateParentCaches(); |