Merge "Correctly invalidate views that transition from opaque to non-opaque. Bug #3337037" into honeycomb
This commit is contained in:
@@ -1813,6 +1813,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
|||||||
private int mPrevWidth = -1;
|
private int mPrevWidth = -1;
|
||||||
private int mPrevHeight = -1;
|
private int mPrevHeight = -1;
|
||||||
|
|
||||||
|
private boolean mLastIsOpaque;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience value to check for float values that are close enough to zero to be considered
|
* Convenience value to check for float values that are close enough to zero to be considered
|
||||||
* zero.
|
* zero.
|
||||||
@@ -6726,7 +6728,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
|||||||
public void invalidate() {
|
public void invalidate() {
|
||||||
invalidate(true);
|
invalidate(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is where the invalidate() work actually happens. A full invalidate()
|
* 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
|
* causes the drawing cache to be invalidated, but this function can be called with
|
||||||
@@ -6743,8 +6745,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
|||||||
ViewDebug.trace(this, ViewDebug.HierarchyTraceType.INVALIDATE);
|
ViewDebug.trace(this, ViewDebug.HierarchyTraceType.INVALIDATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean opaque = isOpaque();
|
||||||
if ((mPrivateFlags & (DRAWN | HAS_BOUNDS)) == (DRAWN | HAS_BOUNDS) ||
|
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;
|
mPrivateFlags &= ~DRAWN;
|
||||||
if (invalidateCache) {
|
if (invalidateCache) {
|
||||||
mPrivateFlags &= ~DRAWING_CACHE_VALID;
|
mPrivateFlags &= ~DRAWING_CACHE_VALID;
|
||||||
|
|||||||
@@ -710,8 +710,10 @@ public final class ViewRoot extends Handler implements ViewParent,
|
|||||||
// object is not initialized to its backing store, but soon it
|
// object is not initialized to its backing store, but soon it
|
||||||
// will be (assuming the window is visible).
|
// will be (assuming the window is visible).
|
||||||
attachInfo.mSurface = mSurface;
|
attachInfo.mSurface = mSurface;
|
||||||
attachInfo.mUse32BitDrawingCache = PixelFormat.formatHasAlpha(lp.format) ||
|
// We used to use the following condition to choose 32 bits drawing caches:
|
||||||
lp.format == PixelFormat.RGBX_8888;
|
// 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.mHasWindowFocus = false;
|
||||||
attachInfo.mWindowVisibility = viewVisibility;
|
attachInfo.mWindowVisibility = viewVisibility;
|
||||||
attachInfo.mRecomputeGlobalAttributes = false;
|
attachInfo.mRecomputeGlobalAttributes = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user