Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16e6f529 authored by Robert Carr's avatar Robert Carr
Browse files

WindowStateAnimator: Finish removing rotation animation path

There is only one clause left in the screenAnimation conditional
that differentiates it from the default computeShownFrameLocked. This
somewhat neublous comment about expanding windows out 1 pixel from their
center in order to fill holes. This code already doesn't do what it says
it does though, it just expands to the bottom/right, not out from the
center. That means if this path is still important (though removing it
doesn't seem to cause any problems) we can accomplish the same effect by
just adding a global scale to the animation.

Bug: 161937501
Test: Existing tests pass
Change-Id: I2ef686976db0b24356f7fea7a7fcfdf54195d13b
parent baa0ab02
Loading
Loading
Loading
Loading
+1 −51
Original line number Original line Diff line number Diff line
@@ -659,57 +659,7 @@ class WindowStateAnimator {
    }
    }


    void computeShownFrameLocked() {
    void computeShownFrameLocked() {
        final ScreenRotationAnimation screenRotationAnimation =
        if (mIsWallpaper && mService.mRoot.mWallpaperActionPending) {
                mWin.getDisplayContent().getRotationAnimation();
        final boolean windowParticipatesInScreenRotationAnimation =
                !mWin.mForceSeamlesslyRotate;
        final boolean screenAnimation = screenRotationAnimation != null
                && screenRotationAnimation.isAnimating()
                && windowParticipatesInScreenRotationAnimation;

        if (screenAnimation) {
            // cache often used attributes locally
            final Rect frame = mWin.getFrameLw();
            final float tmpFloats[] = mService.mTmpFloats;
            final Matrix tmpMatrix = mWin.mTmpMatrix;

            // Compute the desired transformation.
            if (screenRotationAnimation.isRotating()) {
                // If we are doing a screen animation, the global rotation
                // applied to windows can result in windows that are carefully
                // aligned with each other to slightly separate, allowing you
                // to see what is behind them.  An unsightly mess.  This...
                // thing...  magically makes it call good: scale each window
                // slightly (two pixels larger in each dimension, from the
                // window's center).
                final float w = frame.width();
                final float h = frame.height();
                if (w>=1 && h>=1) {
                    tmpMatrix.setScale(1 + 2/w, 1 + 2/h, w/2, h/2);
                } else {
                    tmpMatrix.reset();
                }
            } else {
                tmpMatrix.reset();
            }

            tmpMatrix.postScale(mWin.mGlobalScale, mWin.mGlobalScale);

            // "convert" it into SurfaceFlinger's format
            // (a 2x2 matrix + an offset)
            // Here we must not transform the position of the surface
            // since it is already included in the transformation.
            //Slog.i(TAG_WM, "Transform: " + matrix);

            mHaveMatrix = true;
            tmpMatrix.getValues(tmpFloats);
            mDsDx = tmpFloats[Matrix.MSCALE_X];
            mDtDx = tmpFloats[Matrix.MSKEW_Y];
            mDtDy = tmpFloats[Matrix.MSKEW_X];
            mDsDy = tmpFloats[Matrix.MSCALE_Y];

            return;
        } else if (mIsWallpaper && mService.mRoot.mWallpaperActionPending) {
            return;
            return;
        } else if (mWin.isDragResizeChanged()) {
        } else if (mWin.isDragResizeChanged()) {
            // This window is awaiting a relayout because user just started (or ended)
            // This window is awaiting a relayout because user just started (or ended)