diff options
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index b7d902c..39818d9 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1708,10 +1708,19 @@ public final class ViewRootImpl implements ViewParent, mFullRedrawNeeded = true; mPreviousTransparentRegion.setEmpty(); + // Only initialize up-front if transparent regions are not + // requested, otherwise defer to see if the entire window + // will be transparent if (mAttachInfo.mHardwareRenderer != null) { try { hwInitialized = mAttachInfo.mHardwareRenderer.initialize( mSurface); + if (hwInitialized && (host.mPrivateFlags + & View.PFLAG_REQUEST_TRANSPARENT_REGIONS) == 0) { + // Don't pre-allocate if transparent regions + // are requested as they may not be needed + mSurface.allocateBuffers(); + } } catch (OutOfResourcesException e) { handleOutOfResourcesException(e); return; |
