diff options
| author | Thomas Buhot <thomas.buhot@intel.com> | 2015-12-04 12:18:03 +0100 |
|---|---|---|
| committer | Andriy Naborskyy <andriyn@google.com> | 2016-10-25 18:48:50 -0700 |
| commit | 80e6d8873b79ced40e79fcba0bf793ea6528d20c (patch) | |
| tree | fbddcc7ee6ce3699f4af4dc4af5e7b299facf19f /core/java | |
| parent | 43222cec43e32f352185ca66d01f0aee4abf5989 (diff) | |
DO NOT MERGE ANYWHERE libhwui: make setSurface asynchronous
from AOSP: https://android-review.googlesource.com/#/c/183305/
On the critical path of the cold launch of applications
the main thread of the started application tells the RenderThread
to create a surface. This process is synchronous and blocks
the main thread of the application until the creation
of the EGLContext is complete.
As a consequence the launch time of the application is delayed
by time spent allocating the EGL Context in the RenderThread.
With this optimization the launch time of any application
is improved (for example settings by 20 to 40 ms).
Change-Id: Ibf47aaa0abb8dedf7aa00693073db3785d9d6b08
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/ThreadedRenderer.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java index f6119e2898f0..db147ab51263 100644 --- a/core/java/android/view/ThreadedRenderer.java +++ b/core/java/android/view/ThreadedRenderer.java @@ -145,9 +145,10 @@ public class ThreadedRenderer extends HardwareRenderer { @Override boolean initialize(Surface surface) throws OutOfResourcesException { + boolean status = !mInitialized; mInitialized = true; updateEnabledState(surface); - boolean status = nInitialize(mNativeProxy, surface); + nInitialize(mNativeProxy, surface); return status; } @@ -503,7 +504,7 @@ public class ThreadedRenderer extends HardwareRenderer { private static native boolean nLoadSystemProperties(long nativeProxy); private static native void nSetName(long nativeProxy, String name); - private static native boolean nInitialize(long nativeProxy, Surface window); + private static native void nInitialize(long nativeProxy, Surface window); private static native void nUpdateSurface(long nativeProxy, Surface window); private static native boolean nPauseSurface(long nativeProxy, Surface window); private static native void nSetup(long nativeProxy, int width, int height, |
