diff options
-rw-r--r-- | core/java/android/view/ViewRootImpl.java | 6 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 42402eb..97476f2 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1721,12 +1721,6 @@ 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 6dfb6e8..33eb3f1 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -31,6 +31,7 @@ #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 @@ -115,6 +116,10 @@ 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; } |