diff options
author | Michael Jurka <mikejurka@google.com> | 2011-11-14 23:53:34 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-14 23:53:34 -0800 |
commit | 4b7494e07a44c0aa363379be463de70455a895f3 (patch) | |
tree | 8d94cfa5bd7a5ab578bd9c830907cc3471cbbab8 /services | |
parent | d968670d8369e5d92ba9b7a45b3804d692a05a4e (diff) | |
parent | bfd24acd318ef958bb7997c9cbf95c5fb15b10ac (diff) | |
download | frameworks_base-4b7494e07a44c0aa363379be463de70455a895f3.zip frameworks_base-4b7494e07a44c0aa363379be463de70455a895f3.tar.gz frameworks_base-4b7494e07a44c0aa363379be463de70455a895f3.tar.bz2 |
Merge "Updating recent apps visuals on tablet" into ics-mr1
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 50321b3..ebb13d5 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -5090,10 +5090,22 @@ public class WindowManagerService extends IWindowManager.Stub // Constrain thumbnail to smaller of screen width or height. Assumes aspect // of thumbnail is the same as the screen (in landscape) or square. + float targetWidthScale = width / (float) fw; + float targetHeightScale = height / (float) fh; if (dw <= dh) { - scale = width / (float) fw; // portrait + scale = targetWidthScale; + // If aspect of thumbnail is the same as the screen (in landscape), + // select the slightly larger value so we fill the entire bitmap + if (targetHeightScale > scale && (int) (targetHeightScale * fw) == width) { + scale = targetHeightScale; + } } else { - scale = height / (float) fh; // landscape + scale = targetHeightScale; + // If aspect of thumbnail is the same as the screen (in landscape), + // select the slightly larger value so we fill the entire bitmap + if (targetWidthScale > scale && (int) (targetWidthScale * fh) == height) { + scale = targetWidthScale; + } } // The screen shot will contain the entire screen. |