OSDN Git Service

Make recents use immutable ashmem bitmaps for things it frequently passes across...
authorRiley Andrews <riandrews@google.com>
Mon, 11 May 2015 23:11:01 +0000 (16:11 -0700)
committerRiley Andrews <riandrews@google.com>
Mon, 18 May 2015 19:56:54 +0000 (19:56 +0000)
Bug 21037890
Change-Id: Ieb29be3ff68f3db3f07df02f171325ed77915fdf

packages/SystemUI/src/com/android/systemui/recents/Recents.java
packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java

index 2d1fab0..c702673 100644 (file)
@@ -621,10 +621,11 @@ public class Recents extends SystemUI
                 mHeaderBar.draw(c);
                 c.setBitmap(null);
             }
+            Bitmap thumbnailImmutable = thumbnail.createAshmemBitmap();
 
             mStartAnimationTriggered = false;
             return ActivityOptions.makeThumbnailAspectScaleDownAnimation(mDummyStackView,
-                    thumbnail, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
+                    thumbnailImmutable, toTaskRect.left, toTaskRect.top, toTaskRect.width(),
                     toTaskRect.height(), mHandler, this);
         }
 
index 1377975..b3e6221 100644 (file)
@@ -490,6 +490,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
                 // Notify the system to skip the thumbnail layer by using an ALPHA_8 bitmap
                 b = Bitmap.createBitmap(1, 1, Bitmap.Config.ALPHA_8);
             }
+            Bitmap bImmut = b.createAshmemBitmap();
             ActivityOptions.OnAnimationStartedListener animStartedListener = null;
             if (lockToTask) {
                 animStartedListener = new ActivityOptions.OnAnimationStartedListener() {
@@ -515,7 +516,7 @@ public class RecentsView extends FrameLayout implements TaskStackView.TaskStackV
                         sourceView.getHandler(), animStartedListener);
             } else {
                 opts = ActivityOptions.makeThumbnailAspectScaleUpAnimation(sourceView,
-                        b, offsetX, offsetY, transform.rect.width(), transform.rect.height(),
+                        bImmut, offsetX, offsetY, transform.rect.width(), transform.rect.height(),
                         sourceView.getHandler(), animStartedListener);
             }
         }