diff options
author | Romain Guy <romainguy@google.com> | 2011-01-21 19:06:00 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-21 19:06:00 -0800 |
commit | d832d0b2406b930f04be1bbecd1da826c045c958 (patch) | |
tree | ad57b47d3dec1d5742dff9af47a21971fff10dda /core | |
parent | 4935bf26f75850ef44a673a7ef4c6234b3df0467 (diff) | |
parent | 10444a138ae98e940982096d802b2655cef0b645 (diff) | |
download | frameworks_base-d832d0b2406b930f04be1bbecd1da826c045c958.zip frameworks_base-d832d0b2406b930f04be1bbecd1da826c045c958.tar.gz frameworks_base-d832d0b2406b930f04be1bbecd1da826c045c958.tar.bz2 |
am 10444a13: am 596ba2fa: Merge "Correctly invalidate views that transition from opaque to non-opaque. Bug #3337037" into honeycomb
* commit '10444a138ae98e940982096d802b2655cef0b645':
Correctly invalidate views that transition from opaque to non-opaque. Bug #3337037
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/View.java | 9 | ||||
-rw-r--r-- | core/java/android/view/ViewRoot.java | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 2576af9..8bcd0a3 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -1813,6 +1813,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private int mPrevWidth = -1; private int mPrevHeight = -1; + private boolean mLastIsOpaque; + /** * Convenience value to check for float values that are close enough to zero to be considered * zero. @@ -6767,7 +6769,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility public void invalidate() { invalidate(true); } - + /** * This is where the invalidate() work actually happens. A full invalidate() * causes the drawing cache to be invalidated, but this function can be called with @@ -6784,8 +6786,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility ViewDebug.trace(this, ViewDebug.HierarchyTraceType.INVALIDATE); } + boolean opaque = isOpaque(); if ((mPrivateFlags & (DRAWN | HAS_BOUNDS)) == (DRAWN | HAS_BOUNDS) || - (invalidateCache && (mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID)) { + (invalidateCache && (mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID) || + opaque != mLastIsOpaque) { + mLastIsOpaque = opaque; mPrivateFlags &= ~DRAWN; if (invalidateCache) { mPrivateFlags &= ~DRAWING_CACHE_VALID; diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index 49d28d8..19ecb60 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -715,8 +715,10 @@ public final class ViewRoot extends Handler implements ViewParent, // object is not initialized to its backing store, but soon it // will be (assuming the window is visible). attachInfo.mSurface = mSurface; - attachInfo.mUse32BitDrawingCache = PixelFormat.formatHasAlpha(lp.format) || - lp.format == PixelFormat.RGBX_8888; + // We used to use the following condition to choose 32 bits drawing caches: + // PixelFormat.hasAlpha(lp.format) || lp.format == PixelFormat.RGBX_8888 + // However, windows are now always 32 bits by default, so choose 32 bits + attachInfo.mUse32BitDrawingCache = true; attachInfo.mHasWindowFocus = false; attachInfo.mWindowVisibility = viewVisibility; attachInfo.mRecomputeGlobalAttributes = false; |