diff options
author | Mathias Agopian <mathias@google.com> | 2009-09-16 20:15:42 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-09-16 20:15:42 -0700 |
commit | 0928bee979c8fa157e13e37e52ba9ad94e935237 (patch) | |
tree | ad2dd7b6efea2685749ca63919fb01a31446553f /libs | |
parent | e8d23a23ee25069dd16a3aeb087ad6ea0f0f2fe9 (diff) | |
download | frameworks_native-0928bee979c8fa157e13e37e52ba9ad94e935237.zip frameworks_native-0928bee979c8fa157e13e37e52ba9ad94e935237.tar.gz frameworks_native-0928bee979c8fa157e13e37e52ba9ad94e935237.tar.bz2 |
disable backbuffer preservation when possible, which may improve performance a bit
Diffstat (limited to 'libs')
-rw-r--r-- | libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp index d893f0a..cc913cb 100644 --- a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp +++ b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp @@ -174,6 +174,13 @@ void DisplayHardware::init(uint32_t dpy) surface = eglCreateWindowSurface(display, config, mNativeWindow.get(), NULL); + if (mFlags & UPDATE_ON_DEMAND) { + // if we have update on demand, we definitely don't need to + // preserve the backbuffer, which is usually costly. + eglSurfaceAttrib(display, surface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); + } + if (eglQuerySurface(display, surface, EGL_SWAP_BEHAVIOR, &dummy) == EGL_TRUE) { if (dummy == EGL_BUFFER_PRESERVED) { mFlags |= BUFFER_PRESERVED; |