summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorThomas Buhot <thomas.buhot@intel.com>2015-10-02 14:12:12 +0200
committerSteve Kondik <steve@cyngn.com>2015-11-29 05:50:35 -0800
commita9cdd4ff38aed1fb1bac64caec97bfb0b72d0ce9 (patch)
tree4443031f61cf1adbf429f5e3878a93e7c228a52c /libs
parent3973c59b77243793c9f5d9aed7a44483decf8c17 (diff)
downloadframeworks_base-a9cdd4ff38aed1fb1bac64caec97bfb0b72d0ce9.zip
frameworks_base-a9cdd4ff38aed1fb1bac64caec97bfb0b72d0ce9.tar.gz
frameworks_base-a9cdd4ff38aed1fb1bac64caec97bfb0b72d0ce9.tar.bz2
libhwui: make surface buffer allocation asynchronous
On the critical path of the cold launch of applications the main thread of the started application allocates the surface buffer. The allocation is synchronous and blocks the main thread of the application. As a consequence the launch time of the application is delayed by the time spent doing the allocation. With this optimization the allocation is performed asynchronously in the RenderThread. This optimization will benefit to the launch of all applications. Change-Id: I4bc145cfc3ba6fe1efbca519bcee2e4ea6617ae7 Signed-off-by: Thomas Buhot <thomas.buhot@intel.com> Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/renderthread/CanvasContext.cpp5
1 files changed, 5 insertions, 0 deletions
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;
}