summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-06-07 17:08:34 -0700
committerRomain Guy <romainguy@google.com>2010-06-07 17:08:34 -0700
commit8783a051580340af1e32b1e09eab3cdd89b3dca8 (patch)
tree0566590bad44073935cfb494b140c522f5278621
parent81a9248156ecd099e4b1bd1b9541436be2a5b57f (diff)
downloadandroid_packages_apps_Trebuchet-8783a051580340af1e32b1e09eab3cdd89b3dca8.tar.gz
android_packages_apps_Trebuchet-8783a051580340af1e32b1e09eab3cdd89b3dca8.tar.bz2
android_packages_apps_Trebuchet-8783a051580340af1e32b1e09eab3cdd89b3dca8.zip
Improve workspace's scrolling performance.
This is achieved by moving the 3D All Apps surface out of the screen when it is not needed anymore. This saves us compositing costs that slow down the drawing of the workspace. Change-Id: I06ce1f77449fe1864517f4161913bc162c8e6b46
-rw-r--r--src/com/android/launcher2/AllApps3D.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java
index 9c3b3e4c7..b8aa8eccf 100644
--- a/src/com/android/launcher2/AllApps3D.java
+++ b/src/com/android/launcher2/AllApps3D.java
@@ -961,7 +961,23 @@ public class AllApps3D extends RSSurfaceView
public void run() {
sRollo.mScrollPos = ((float)mData[0]) / (1 << 16);
mVelocity = ((float)mData[1]) / (1 << 16);
+
+ boolean lastVisible = isVisible();
mZoom = ((float)mData[2]) / (1 << 16);
+
+ final boolean visible = isVisible();
+ if (visible != lastVisible) {
+ post(new Runnable() {
+ public void run() {
+ if (visible) {
+ showSurface();
+ } else {
+ hideSurface();
+ }
+ }
+ });
+ }
+
sZoomDirty = false;
}
}