summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/DisplayHardware
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-09-16 20:15:42 -0700
committerMathias Agopian <mathias@google.com>2009-09-16 20:15:42 -0700
commitaf369f6280c9eec0caa3f53f8e27f3713e1a7d25 (patch)
tree8021b39056c7e3e0ce50d8a6b26a4b6459aecbfa /libs/surfaceflinger/DisplayHardware
parent75c4d498776a189f37e3d0294c9eda9ed51f6534 (diff)
downloadframeworks_base-af369f6280c9eec0caa3f53f8e27f3713e1a7d25.zip
frameworks_base-af369f6280c9eec0caa3f53f8e27f3713e1a7d25.tar.gz
frameworks_base-af369f6280c9eec0caa3f53f8e27f3713e1a7d25.tar.bz2
disable backbuffer preservation when possible, which may improve performance a bit
Diffstat (limited to 'libs/surfaceflinger/DisplayHardware')
-rw-r--r--libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp7
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;