Merge "Make sure preserved surface is removed when it's no longer needed" into nyc-dev
This commit is contained in:
@@ -329,11 +329,14 @@ class AppWindowToken extends WindowToken {
|
||||
final DisplayContentList displayList = new DisplayContentList();
|
||||
for (int i = allWindows.size() - 1; i >= 0; i--) {
|
||||
final WindowState win = allWindows.get(i);
|
||||
if (!win.mDestroying) {
|
||||
|
||||
if (!(mAppStopped || win.mWindowRemovalAllowed)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(mAppStopped || win.mWindowRemovalAllowed)) {
|
||||
win.mWinAnimator.destroyPreservedSurfaceLocked();
|
||||
|
||||
if (!win.mDestroying) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -659,6 +659,13 @@ class WindowStateAnimator {
|
||||
mDestroyPreservedSurfaceUponRedraw = false;
|
||||
}
|
||||
|
||||
void markPreservedSurfaceForDestroy() {
|
||||
if (mDestroyPreservedSurfaceUponRedraw
|
||||
&& !mService.mDestroyPreservedSurface.contains(mWin)) {
|
||||
mService.mDestroyPreservedSurface.add(mWin);
|
||||
}
|
||||
}
|
||||
|
||||
WindowSurfaceController createSurfaceLocked() {
|
||||
final WindowState w = mWin;
|
||||
if (w.hasSavedSurface()) {
|
||||
@@ -1518,9 +1525,7 @@ class WindowStateAnimator {
|
||||
|
||||
if (prepared && mLastHidden && mDrawState == HAS_DRAWN) {
|
||||
if (showSurfaceRobustlyLocked()) {
|
||||
if (mDestroyPreservedSurfaceUponRedraw) {
|
||||
mService.mDestroyPreservedSurface.add(mWin);
|
||||
}
|
||||
markPreservedSurfaceForDestroy();
|
||||
mAnimator.requestRemovalOfReplacedWindows(w);
|
||||
mLastHidden = false;
|
||||
if (mIsWallpaper) {
|
||||
|
||||
Reference in New Issue
Block a user