diff options
| author | 2014-11-12 16:33:52 -0800 | |
|---|---|---|
| committer | 2015-05-18 19:56:33 +0000 | |
| commit | b2694cc3ee0e042bcd6564c68bc0349668eed30f (patch) | |
| tree | 033b3b3a3169e13b884ec45a6726a623d18f0c1f | |
| parent | 721ae5fec5f1fd4f93aa2a361a0ac298e15ce353 (diff) | |
Make return of screenshotApplications an ashmem immutable bitmap.
Bug 21037890
Change-Id: I47a2ba11d26ec03a6e2e847f5af61b44efa2aa69
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index ebec172d52fe..36445060b7cc 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -6380,10 +6380,9 @@ public class WindowManagerService extends IWindowManager.Stub } } - // Copy the screenshot bitmap to another buffer so that the gralloc backed - // bitmap will not have a long lifetime. Gralloc memory can be pinned or - // duplicated and might have a higher cost than a skia backed buffer. - Bitmap ret = bm.copy(bm.getConfig(),true); + // Create a copy of the screenshot that is immutable and backed in ashmem. + // This greatly reduces the overhead of passing the bitmap between processes. + Bitmap ret = bm.createAshmemBitmap(); bm.recycle(); return ret; } |