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

Commit 8c56e343 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Correct crop on corresponding rotation animation

Otherwise the clip animation on enter surface is missing.
Forgot to upload the latest local change.

Bug: 438615184
Flag: com.android.window.flags.no_alpha_rotation_enter_animation
Test: Trigger display rotation.
Change-Id: I830161b5439cce89c9c934c5d67fc277471286ef
parent e58b13fc
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -357,15 +357,18 @@ class ScreenRotationAnimation {

    private void startDisplayRotation(@NonNull ArrayList<Animator> animations,
            @NonNull Runnable finishCallback, @NonNull ShellExecutor mainExecutor) {
        final Rect clipRect = com.android.window.flags.Flags.noAlphaRotationEnterAnimation()
                ? new Rect(0, 0, mEndWidth, mEndHeight) : null;
        buildSurfaceAnimation(animations, mRotateEnterAnimation, getEnterSurface(), finishCallback,
                mTransactionPool, mainExecutor, null /* position */, 0 /* cornerRadius */,
                null /* clipRect */, null);
                clipRect, null);
    }

    private void startScreenshotRotationAnimation(@NonNull ArrayList<Animator> animations,
            @NonNull Runnable finishCallback, @NonNull ShellExecutor mainExecutor) {
        final Rect clipRect = com.android.window.flags.Flags.noAlphaRotationEnterAnimation()
                ? new Rect(0, 0, mEndWidth, mEndHeight) : null;
                // Inverse size because the screenshot layer has rotated transformation.
                ? new Rect(0, 0, mStartHeight, mStartWidth) : null;
        buildSurfaceAnimation(animations, mRotateExitAnimation, mAnimLeash, finishCallback,
                mTransactionPool, mainExecutor, null /* position */, 0 /* cornerRadius */,
                clipRect, null);
@@ -373,12 +376,9 @@ class ScreenRotationAnimation {

    private void buildScreenshotAlphaAnimation(@NonNull ArrayList<Animator> animations,
            @NonNull Runnable finishCallback, @NonNull ShellExecutor mainExecutor) {
        final Rect clipRect = com.android.window.flags.Flags.noAlphaRotationEnterAnimation()
                // Inverse size because the screenshot layer has rotated transformation.
                ? new Rect(0, 0, mStartHeight, mStartWidth) : null;
        buildSurfaceAnimation(animations, mRotateAlphaAnimation, mAnimLeash, finishCallback,
                mTransactionPool, mainExecutor, null /* position */, 0 /* cornerRadius */,
                clipRect, null);
                null /* clipRect */, null);
    }

    private void buildLumaAnimation(@NonNull ArrayList<Animator> animations,