Make recents use immutable ashmem bitmaps for things it frequently passes across binder.

Bug 21037890
Change-Id: Ieb29be3ff68f3db3f07df02f171325ed77915fdf
This commit is contained in:
Riley Andrews
2015-05-11 16:11:01 -07:00
parent b2694cc3ee
commit 5ac56502e3
2 changed files with 4 additions and 2 deletions

View 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);
}

View 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);
}
}