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

Commit ed3c321c authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Do not set early wakeup flag for inset animations" into rvc-dev

parents f16e13cc 33a35ef0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -724,12 +724,13 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
            mApplier = new SyncRtSurfaceTransactionApplier(mViewRoot.mView);
        }
        if (mViewRoot.mView.isHardwareAccelerated()) {
            mApplier.scheduleApply(params);
            mApplier.scheduleApply(false /* earlyWakeup */, params);
        } else {
            // Window doesn't support hardware acceleration, no synchronization for now.
            // TODO(b/149342281): use mViewRoot.mSurface.getNextFrameNumber() to sync on every
            //  frame instead.
            mApplier.applyParams(new Transaction(), -1 /* frame */, params);
            mApplier.applyParams(new Transaction(), -1 /* frame */, false /* earlyWakeup */,
                    params);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -605,7 +605,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                mTmpRect.set(0, 0, mSurfaceWidth, mSurfaceHeight);
            }
            SyncRtSurfaceTransactionApplier applier = new SyncRtSurfaceTransactionApplier(this);
            applier.scheduleApply(
            applier.scheduleApply(false /* earlyWakeup */,
                    new SyncRtSurfaceTransactionApplier.SurfaceParams.Builder(mSurfaceControl)
                            .withWindowCrop(mTmpRect)
                            .build());
+9 −4
Original line number Diff line number Diff line
@@ -53,10 +53,11 @@ public class SyncRtSurfaceTransactionApplier {
    /**
     * Schedules applying surface parameters on the next frame.
     *
     * @param earlyWakeup Whether to set {@link Transaction#setEarlyWakeup()} on transaction.
     * @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
     *               this method to avoid synchronization issues.
     */
    public void scheduleApply(final SurfaceParams... params) {
    public void scheduleApply(boolean earlyWakeup, final SurfaceParams... params) {
        if (mTargetViewRootImpl == null) {
            return;
        }
@@ -66,7 +67,7 @@ public class SyncRtSurfaceTransactionApplier {
                return;
            }
            Transaction t = new Transaction();
            applyParams(t, frame, params);
            applyParams(t, frame, earlyWakeup, params);
        });

        // Make sure a frame gets scheduled.
@@ -77,10 +78,12 @@ public class SyncRtSurfaceTransactionApplier {
     * Applies surface parameters on the next frame.
     * @param t transaction to apply all parameters in.
     * @param frame frame to synchronize to. Set -1 when sync is not required.
     * @param earlyWakeup Whether to set {@link Transaction#setEarlyWakeup()} on transaction.
     * @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
     *               this method to avoid synchronization issues.
     */
    void applyParams(Transaction t, long frame, final SurfaceParams... params) {
     void applyParams(Transaction t, long frame, boolean earlyWakeup,
            final SurfaceParams... params) {
        for (int i = params.length - 1; i >= 0; i--) {
            SurfaceParams surfaceParams = params[i];
            SurfaceControl surface = surfaceParams.surface;
@@ -89,7 +92,9 @@ public class SyncRtSurfaceTransactionApplier {
            }
            applyParams(t, surfaceParams, mTmpFloat9);
        }
        if (earlyWakeup) {
            t.setEarlyWakeup();
        }
        t.apply();
    }

+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ public class ActivityLaunchAnimator {
                    .withCornerRadius(mCornerRadius)
                    .withVisibility(true)
                    .build();
            mSyncRtTransactionApplier.scheduleApply(params);
            mSyncRtTransactionApplier.scheduleApply(true /* earlyWakeup */, params);
        }

        @Override