summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/ViewRootImpl.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-05-20 14:23:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-20 14:23:24 +0000
commit97bf518f7b818d297a500204627d1ad06127bff1 (patch)
tree89eb2a0339cd3748532b30f5529607bdd6bcc871 /core/java/android/view/ViewRootImpl.java
parent4430f16cedf0434e376eedc8557cbfdddf63c4b1 (diff)
parent63005e6e5b1ee6d32a217ce8b4d8f0d13987fc39 (diff)
downloadframeworks_base-97bf518f7b818d297a500204627d1ad06127bff1.zip
frameworks_base-97bf518f7b818d297a500204627d1ad06127bff1.tar.gz
frameworks_base-97bf518f7b818d297a500204627d1ad06127bff1.tar.bz2
Merge "Reduce wasted buffer allocations" into mnc-dev
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
-rw-r--r--core/java/android/view/ViewRootImpl.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index c4f9209..41f906a 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1705,10 +1705,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;