summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-29 18:53:53 -0700
committerMathias Agopian <mathias@google.com>2009-06-29 18:57:42 -0700
commit3a6b160a3b52cd96fb383d5ee93c22e5e938e0e2 (patch)
tree69e19f9d77d76bf37857cf1aeb2ace21919d84da
parentecfa7ccd4fc3066a4cfd4d84d7de286d95581c78 (diff)
downloadframeworks_base-3a6b160a3b52cd96fb383d5ee93c22e5e938e0e2.zip
frameworks_base-3a6b160a3b52cd96fb383d5ee93c22e5e938e0e2.tar.gz
frameworks_base-3a6b160a3b52cd96fb383d5ee93c22e5e938e0e2.tar.bz2
when there is a choice between UPDATE_ON_DEMAND and SWAP_BUFFER optimizations, choose UPDATE_ON_DEMAND which is often more efficient.
-rw-r--r--libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
index 3ce93c0..5c522c5 100644
--- a/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
+++ b/libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp
@@ -211,7 +211,12 @@ void DisplayHardware::init(uint32_t dpy)
if (strstr(egl_extensions, "EGL_ANDROID_swap_rectangle")) {
mFlags |= SWAP_RECTANGLE;
}
+ // when we have the choice between UPDATE_ON_DEMAND and SWAP_RECTANGLE
+ // choose UPDATE_ON_DEMAND, which is more efficient
+ if (mFlags & UPDATE_ON_DEMAND)
+ mFlags &= ~SWAP_RECTANGLE;
#endif
+
mDpiX = mNativeWindow->xdpi;
mDpiX = mNativeWindow->ydpi;