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

Commit d23ee155 authored by Robert Carr's avatar Robert Carr
Browse files

WindowStateAnimator: Remove redundant Alpha operation.

We apply the ScreenRotationAnimation alpha at higher levels of the hierarchy, so I think this was actually doubling the alpha application (e.g. instead of .7 alpha we would ultimately set .7 of .7
alpha).

Bug: 161937501
Test: Existing tests pass
Change-Id: Ifba8b7d962dd3119bc5a8cbbfa2a246604a46987
parent f7c04c3a
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -101,7 +101,6 @@ class ScreenRotationAnimation {
    private final Transformation mRotateExitTransformation = new Transformation();
    private final Transformation mRotateEnterTransformation = new Transformation();
    // Complete transformations being applied.
    private final Transformation mEnterTransformation = new Transformation();
    private final Matrix mSnapshotInitialMatrix = new Matrix();
    private final WindowManagerService mService;
    /** Only used for custom animations and not screen rotation. */
@@ -309,8 +308,6 @@ class ScreenRotationAnimation {
        pw.print(" "); mRotateExitTransformation.printShortString(pw); pw.println();
        pw.print(prefix); pw.print("mRotateEnterAnimation="); pw.print(mRotateEnterAnimation);
        pw.print(" "); mRotateEnterTransformation.printShortString(pw); pw.println();
        pw.print(prefix); pw.print("mEnterTransformation=");
        mEnterTransformation.printShortString(pw); pw.println();
        pw.print(prefix); pw.print("mSnapshotInitialMatrix=");
        mSnapshotInitialMatrix.dump(pw); pw.println();
        pw.print(prefix); pw.print("mForceDefaultOrientation="); pw.print(mForceDefaultOrientation);
@@ -508,10 +505,6 @@ class ScreenRotationAnimation {
        return mCurRotation != mOriginalRotation;
    }

    public Transformation getEnterTransformation() {
        return mEnterTransformation;
    }

    /**
     * Utility class that runs a {@link ScreenRotationAnimation} on the {@link
     * SurfaceAnimationRunner}.
+0 −17
Original line number Diff line number Diff line
@@ -714,23 +714,6 @@ class WindowStateAnimator {
            mDtDy = tmpFloats[Matrix.MSKEW_X];
            mDsDy = tmpFloats[Matrix.MSCALE_Y];

            // Now set the alpha...  but because our current hardware
            // can't do alpha transformation on a non-opaque surface,
            // turn it off if we are running an animation that is also
            // transforming since it is more important to have that
            // animation be smooth.
            mShownAlpha = mAlpha;
            if (!mService.mLimitedAlphaCompositing
                    || (!PixelFormat.formatHasAlpha(mWin.mAttrs.format)
                    || (mWin.isIdentityMatrix(mDsDx, mDtDx, mDtDy, mDsDy)))) {
                mShownAlpha *= screenRotationAnimation.getEnterTransformation().getAlpha();
            }

            if ((DEBUG_ANIM || DEBUG) && (mShownAlpha == 1.0 || mShownAlpha == 0.0)) {
                Slog.v(TAG, "computeShownFrameLocked: Animating " + this + " mAlpha=" + mAlpha
                                + " screen=" + (screenAnimation
                        ? screenRotationAnimation.getEnterTransformation().getAlpha() : "null"));
            }
            return;
        } else if (mIsWallpaper && mService.mRoot.mWallpaperActionPending) {
            return;