Request a traversal when a saved surface gets redrawn

When a saved surface gets redrawn, we need to return true in
finishDrawingLocked, so that a traversal is requested. This is
needed to update allDrawn/allDrawnExcludingSaved. Some delayed
window removal may be waiting for these flags.

bug: 28797800
Change-Id: I0b58b356e9c580422eb3ff81e8afb2a164cf6e43
This commit is contained in:
Chong Zhang
2016-05-17 20:46:58 -07:00
parent 94789b4ddf
commit cbbcc0f795
2 changed files with 6 additions and 4 deletions

View File

@@ -2115,14 +2115,16 @@ final class WindowState implements WindowManagerPolicy.WindowState {
mWasVisibleBeforeClientHidden = false;
}
void clearAnimatingWithSavedSurface() {
boolean clearAnimatingWithSavedSurface() {
if (mAnimatingWithSavedSurface) {
// App has drawn something to its windows, we're no longer animating with
// the saved surfaces.
if (DEBUG_ANIM) Slog.d(TAG,
"clearAnimatingWithSavedSurface(): win=" + this);
mAnimatingWithSavedSurface = false;
return true;
}
return false;
}
@Override

View File

@@ -585,7 +585,7 @@ class WindowStateAnimator {
+ drawStateToString());
}
mWin.clearAnimatingWithSavedSurface();
boolean layoutNeeded = mWin.clearAnimatingWithSavedSurface();
if (mDrawState == DRAW_PENDING) {
if (DEBUG_SURFACE_TRACE || DEBUG_ANIM || SHOW_TRANSACTIONS || DEBUG_ORIENTATION)
@@ -595,10 +595,10 @@ class WindowStateAnimator {
Slog.v(TAG, "Draw state now committed in " + mWin);
}
mDrawState = COMMIT_DRAW_PENDING;
return true;
layoutNeeded = true;
}
return false;
return layoutNeeded;
}
// This must be called while inside a transaction.