Merge "Assign layer to bounds animation layer" into qt-dev
This commit is contained in:
@@ -142,7 +142,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
|
||||
/**
|
||||
* Value to increment the z-layer when boosting a layer during animations. BOOST in l33tsp34k.
|
||||
*/
|
||||
private static final int Z_BOOST_BASE = 800570000;
|
||||
@VisibleForTesting static final int Z_BOOST_BASE = 800570000;
|
||||
|
||||
// Non-null only for application tokens.
|
||||
final IApplicationToken appToken;
|
||||
@@ -291,7 +291,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
|
||||
private boolean mFreezingScreen;
|
||||
|
||||
/** Whether this token should be boosted at the top of all app window tokens. */
|
||||
private boolean mNeedsZBoost;
|
||||
@VisibleForTesting boolean mNeedsZBoost;
|
||||
private Letterbox mLetterbox;
|
||||
|
||||
private final Point mTmpPoint = new Point();
|
||||
@@ -2693,7 +2693,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
|
||||
if (mNeedsZBoost) {
|
||||
layer += Z_BOOST_BASE;
|
||||
}
|
||||
leash.setLayer(layer);
|
||||
if (!mNeedsAnimationBoundsLayer) {
|
||||
leash.setLayer(layer);
|
||||
}
|
||||
|
||||
final DisplayContent dc = getDisplayContent();
|
||||
dc.assignStackOrdering();
|
||||
@@ -2730,6 +2732,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
|
||||
|
||||
// Crop to stack bounds.
|
||||
t.setWindowCrop(mAnimationBoundsLayer, mTmpRect);
|
||||
t.setLayer(mAnimationBoundsLayer, layer);
|
||||
|
||||
// Reparent leash to animation bounds layer.
|
||||
t.reparent(leash, mAnimationBoundsLayer);
|
||||
|
||||
@@ -25,6 +25,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.ArgumentMatchers.intThat;
|
||||
|
||||
import android.platform.test.annotations.Presubmit;
|
||||
import android.view.SurfaceControl;
|
||||
@@ -74,6 +75,16 @@ public class AppWindowTokenAnimationTests extends WindowTestsBase {
|
||||
eq(mToken.mAnimationBoundsLayer));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clipAfterAnim_boundsLayerZBoosted() {
|
||||
mToken.mNeedsAnimationBoundsLayer = true;
|
||||
mToken.mNeedsZBoost = true;
|
||||
|
||||
mToken.mSurfaceAnimator.startAnimation(mTransaction, mSpec, true /* hidden */);
|
||||
verify(mTransaction).setLayer(eq(mToken.mAnimationBoundsLayer),
|
||||
intThat(layer -> layer >= AppWindowToken.Z_BOOST_BASE));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clipAfterAnim_boundsLayerIsDestroyed() {
|
||||
mToken.mNeedsAnimationBoundsLayer = true;
|
||||
|
||||
Reference in New Issue
Block a user