summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-07 13:09:37 -0800
committerSteve Kondik <steve@cyngn.com>2015-12-07 18:47:04 -0800
commitd904207b29904a0df0bacd0ad45478fcb0dae97d (patch)
tree3d4003f1fc90ed3c6c8375c0868ff8de536f7283
parenta0b5d767d6dcfa1972a9158564f90e070ac1ead6 (diff)
downloadframeworks_base-d904207b29904a0df0bacd0ad45478fcb0dae97d.zip
frameworks_base-d904207b29904a0df0bacd0ad45478fcb0dae97d.tar.gz
frameworks_base-d904207b29904a0df0bacd0ad45478fcb0dae97d.tar.bz2
Revert "libhwui: make surface buffer allocation asynchronous"
This reverts commit a9cdd4ff38aed1fb1bac64caec97bfb0b72d0ce9. Change-Id: I3be8069c365cc213c9d57d513c1de5be42ace055
-rw-r--r--core/java/android/view/ViewRootImpl.java6
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 97476f2..42402eb 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1721,6 +1721,12 @@ public final class ViewRootImpl implements ViewParent,
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;
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index 33eb3f1..6dfb6e8 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -31,7 +31,6 @@
#include <strings.h>
#include <cutils/properties.h>
#include <private/hwui/DrawGlInfo.h>
-#include <gui/Surface.h>
#define TRIM_MEMORY_COMPLETE 80
#define TRIM_MEMORY_UI_HIDDEN 20
@@ -116,10 +115,6 @@ bool CanvasContext::initialize(ANativeWindow* window) {
if (mCanvas) return false;
mCanvas = new OpenGLRenderer(mRenderThread.renderState());
mCanvas->initProperties();
- if (window) {
- Surface *s = static_cast<Surface*>(window);
- s->allocateBuffers();
- }
return true;
}