diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-04 19:29:25 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-07 15:07:33 -0700 |
commit | df3ca30bf663cb8eed88ee3f16fb5e9a65dc00fc (patch) | |
tree | 2456c7861be6b9ee4b8f87fe086acb9a2b132b3a /opengl/libs/EGL/egl.cpp | |
parent | aa8c0ff7a36b4840dcf3e72c9696b86d192c4314 (diff) | |
download | frameworks_native-df3ca30bf663cb8eed88ee3f16fb5e9a65dc00fc.tar.gz frameworks_native-df3ca30bf663cb8eed88ee3f16fb5e9a65dc00fc.tar.bz2 frameworks_native-df3ca30bf663cb8eed88ee3f16fb5e9a65dc00fc.zip |
created an new EGL extension called ANDROID_swap_rectangle
ANDROID_swap_rectangle allows to specify the rectangle affected by eglSwapBuffers(), anything outside of this rectangle is unchanged. in particular EGL_BUFFER_DESTROYED only applies to that rectangle. This extension as well as EGL_BUFFER_PRESERVED allow major optimizations on surfaceflinger, which can redraw only the dirty area during compositing.
However, ANDROID_swap_rectangle allows further optimizations in EGL by reducing the amount of copy-back needed. ANDROID_swap_rectangle is particularily important for software implementations.
Diffstat (limited to 'opengl/libs/EGL/egl.cpp')
-rw-r--r-- | opengl/libs/EGL/egl.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index 74aed2062..8c37f2e8b 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -60,6 +60,7 @@ static char const * const gExtensionString = "KHR_image_base " "KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " + "EGL_ANDROID_swap_rectangle " ; // ---------------------------------------------------------------------------- @@ -1568,3 +1569,23 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) return EGL_FALSE; } + + +// ---------------------------------------------------------------------------- +// ANDROID extensions +// ---------------------------------------------------------------------------- + +EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, + EGLint left, EGLint top, EGLint width, EGLint height) +{ + if (!validate_display_surface(dpy, draw)) + return EGL_FALSE; + egl_display_t const * const dp = get_display(dpy); + egl_surface_t const * const s = get_surface(draw); + if (s->cnx->hooks->egl.eglSetSwapRectangleANDROID) { + return s->cnx->hooks->egl.eglSetSwapRectangleANDROID(dp->dpys[s->impl], + s->surface, left, top, width, height); + } + return EGL_FALSE; +} + |