summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-09-11 21:13:37 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-14 15:29:44 -0700
commit19382ac1a4e4e7c23a1346d299368763f149de9c (patch)
tree9165f1b94f1bd5e9966729b1047d03a733570867 /core/java/android/view
parent714ec1360cde8b1cbf6e6b8572256e4100f11560 (diff)
downloadframeworks_base-19382ac1a4e4e7c23a1346d299368763f149de9c.zip
frameworks_base-19382ac1a4e4e7c23a1346d299368763f149de9c.tar.gz
frameworks_base-19382ac1a4e4e7c23a1346d299368763f149de9c.tar.bz2
Some optizations to wallpaper drawing/scrolling.
First, fix some issues with the final wallpaper bitmap we use: ensure it is always 16bpp, and make sure dithering of its bitmap is turned off. We take of dithering when loading, to make sure we don't use it when drawing. Also add new APIs to return the wallpaper with the equivalent of Launcher's old FastBitmapDrawable. As doing this, also load the default wallpaper the same way as custom ones, taking care to resize it as needed at load time. Finally implement a mechanism for the window manager to wait for the wallpaper to redraw at its new position before returning from the application's call to change the offset. This ensures that the wallpaper better tracks the application. Note that there is a timeout in this wait that is relatively short, and if it expires we will run for a while without waiting. Change-Id: Ife449437746da85958bd447e0a6cf3d2223b398c
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/IWindow.aidl2
-rw-r--r--core/java/android/view/IWindowSession.aidl2
-rw-r--r--core/java/android/view/ViewRoot.java8
3 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/view/IWindow.aidl b/core/java/android/view/IWindow.aidl
index ebc5f7b..b7953af 100644
--- a/core/java/android/view/IWindow.aidl
+++ b/core/java/android/view/IWindow.aidl
@@ -60,5 +60,5 @@ oneway interface IWindow {
/**
* Called for wallpaper windows when their offsets change.
*/
- void dispatchWallpaperOffsets(float x, float y);
+ void dispatchWallpaperOffsets(float x, float y, boolean sync);
}
diff --git a/core/java/android/view/IWindowSession.aidl b/core/java/android/view/IWindowSession.aidl
index 4d662d2..9b8b6d4 100644
--- a/core/java/android/view/IWindowSession.aidl
+++ b/core/java/android/view/IWindowSession.aidl
@@ -114,4 +114,6 @@ interface IWindowSession {
* larger than the screen, set the offset within the screen.
*/
void setWallpaperPosition(IBinder windowToken, float x, float y);
+
+ void wallpaperOffsetsComplete(IBinder window);
}
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index b61465a..6748ade 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -2868,7 +2868,13 @@ public final class ViewRoot extends Handler implements ViewParent,
}
}
- public void dispatchWallpaperOffsets(float x, float y) {
+ public void dispatchWallpaperOffsets(float x, float y, boolean sync) {
+ if (sync) {
+ try {
+ sWindowSession.wallpaperOffsetsComplete(asBinder());
+ } catch (RemoteException e) {
+ }
+ }
}
}