- Fix screen rotation anim by pulling it back to DC.
- Fix surface insets by correcting at WindowState.prepareSurfaces,
and then going into the other direction in the WSA.
Test: Open PopupWindow, observe shadow is not clipping
Test: Rotate screen, ensure the animation is correct
Test: go/wm-smoke
Bug:
64674361
Change-Id: I0e0910a72aa5f06b86d4e90061e4f807fb164316
*/
private final ArrayList<SurfaceControl> mPendingDestroyingSurfaces = new ArrayList<>();
+ /** Temporary float array to retrieve 3x3 matrix values. */
+ private final float[] mTmpFloats = new float[9];
+
private final Consumer<WindowState> mUpdateWindowsForAnimator = w -> {
WindowStateAnimator winAnimator = w.mWinAnimator;
final AppWindowToken atoken = w.mAppToken;
}
mPendingDestroyingSurfaces.clear();
}
+
+ @Override
+ void prepareSurfaces() {
+ final ScreenRotationAnimation screenRotationAnimation =
+ mService.mAnimator.getScreenRotationAnimationLocked(mDisplayId);
+ if (screenRotationAnimation != null && screenRotationAnimation.isAnimating()) {
+ screenRotationAnimation.getEnterTransformation().getMatrix().getValues(mTmpFloats);
+ mPendingTransaction.setMatrix(mWindowingLayer,
+ mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
+ mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
+ mPendingTransaction.setPosition(mWindowingLayer,
+ mTmpFloats[Matrix.MTRANS_X], mTmpFloats[Matrix.MTRANS_Y]);
+ mPendingTransaction.setAlpha(mWindowingLayer,
+ screenRotationAnimation.getEnterTransformation().getAlpha());
+ }
+ super.prepareSurfaces();
+ }
}
left -= parent.mFrame.left;
top -= parent.mFrame.top;
}
+
+ // Expand for surface insets. See WindowState.expandForSurfaceInsets.
+ left -= mAttrs.surfaceInsets.left;
+ top -= mAttrs.surfaceInsets.top;
mSurfacePosition.set(left, top);
if (!mSurfaceAnimator.hasLeash()) {
t.setPosition(mSurfaceControl, mSurfacePosition.x, mSurfacePosition.y);
}
tmpMatrix.postScale(mWin.mGlobalScale, mWin.mGlobalScale);
+ // WindowState.prepareSurfaces expands for surface insets (in order they don't get
+ // clipped by the WindowState surface), so we need to go into the other direction here.
+ tmpMatrix.postTranslate(mWin.mXOffset + mWin.mAttrs.surfaceInsets.left,
+ mWin.mYOffset + mWin.mAttrs.surfaceInsets.top);
+
if (appTransformation != null) {
tmpMatrix.postConcat(appTransformation.getMatrix());
}
- tmpMatrix.postTranslate(mWin.mXOffset, mWin.mYOffset);
-
- if (screenAnimation) {
- tmpMatrix.postConcat(screenRotationAnimation.getEnterTransformation().getMatrix());
- }
-
// "convert" it into SurfaceFlinger's format
// (a 2x2 matrix + an offset)
// Here we must not transform the position of the surface
TAG, "computeShownFrameLocked: " + this +
" not attached, mAlpha=" + mAlpha);
- mWin.mShownPosition.set(mWin.mXOffset, mWin.mYOffset);
+ // WindowState.prepareSurfaces expands for surface insets (in order they don't get
+ // clipped by the WindowState surface), so we need to go into the other direction here.
+ mWin.mShownPosition.set(mWin.mXOffset + mWin.mAttrs.surfaceInsets.left,
+ mWin.mYOffset + mWin.mAttrs.surfaceInsets.top);
mShownAlpha = mAlpha;
mHaveMatrix = false;
mDsDx = mWin.mGlobalScale;