OSDN Git Service

Load EGL early in Activity launch, instead of in Zygote
authorJesse Hall <jessehall@google.com>
Fri, 20 Jan 2017 01:59:08 +0000 (17:59 -0800)
committerJesse Hall <jessehall@google.com>
Fri, 20 Jan 2017 23:58:20 +0000 (15:58 -0800)
commitfd104e7fde7f53700da58cbab57d73b938b837a7
treeb8011607d809cf0d1372538ee46b04dd7e58945a
parent20cf769d96f1a2dae9e99d50f0d3dedc1e92b83f
Load EGL early in Activity launch, instead of in Zygote

Preloading EGL in Zygote was originally a memory footprint
optimization, but it turns out to be an important app startup time
optimization as well. Preloading EGL in Zygote is incompatible with
updatable graphics drivers, but we don't want to do it on-demand as
part of drawing the first frame either, since that increases
first-frame latency unacceptably.

This change removes Zygote preload, and instead loads EGL on a
low-priority background thread immediately after choosing which
graphics driver to use. This means it is usually done well before
drawing the first frame, without significantly disrupting other
activity launch work.

Test: observe systrace of Calculator launch on bullhead
Bug: 34404021
Change-Id: I6a0f6b90ade21848a10d51ddae62c936f70151b5
Merged-In: I887aa09bd35b088b16f53a89838a0c7c98f15761
core/java/android/os/GraphicsEnvironment.java
core/java/com/android/internal/os/ZygoteInit.java