replicant-frameworks_native/opengl
Jesse Hall 258385978c Hibernate the EGL implementation when idle
If the EGL implementation supports the EGL_IMG_hibernate_process
extension, use it to hibernate (and hopefully release memory or other
resources) when the process isn't actively using EGL or OpenGL ES. The
idleness heuristic used in this change is:

(a) Wake up when entering any EGL API call, and remain awake for the
    duration of the call.
(b) Do not hibernate when any window surface exists; this means the
    application is very likely in the foreground.
(c) Do not hibernate while any context is made current to a thread.
    The app may be using a client API without the EGL layer knowing,
    so it is not safe to hibernate.
(d) Only check these conditions and attempt to hibernate after a
    window surface is destroyed or a thread's context is detached. By
    not attempting to hibernate at the end of every EGL call, we avoid
    some transient wakeups/hibernate cycles when the app is mostly idle,
    or is starting to become active but hasn't created its window
    surface yet.

On a Galaxy Nexus, hibernating frees 1567 VM pages from the process.
Both hibernating and waking can take anywhere from 30ms to over 100ms
-- measurements have been very inconsistent.

Change-Id: Ib555f5d9d069aefccca06e8173a89625b5f32d7e
2012-04-09 21:36:17 -07:00
..
include Hibernate the EGL implementation when idle 2012-04-09 21:36:17 -07:00
libagl libagl shouldn't export anything 2012-02-27 13:03:04 -08:00
libs Hibernate the EGL implementation when idle 2012-04-09 21:36:17 -07:00
specs add a way to access the version string of the h/w implementation of EGL 2011-11-29 18:00:35 -08:00
tests frameworks/native: prevent some opengl tests from building in pdk 2012-03-26 16:01:43 -07:00
tools/glgen GLES: add image external enums 2011-11-15 11:35:46 -08:00