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

Commit 22b48e45 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reapply "Apply pending transactions always"" into main

parents 11419236 9d22d0f2
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -4345,6 +4345,7 @@ public final class ViewRootImpl implements ViewParent,
            handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
                    mPendingTransaction, "view not visible");
            mHasPendingTransactions = false;
        } else if (cancelAndRedraw) {
            if (!mWasLastDrawCanceled) {
                logAndTrace("Canceling draw."
@@ -4372,6 +4373,7 @@ public final class ViewRootImpl implements ViewParent,
            if (!performDraw(mActiveSurfaceSyncGroup)) {
                handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
                        mPendingTransaction, mLastPerformDrawSkippedReason);
                mHasPendingTransactions = false;
            }
        }
        mWasLastDrawCanceled = cancelAndRedraw;
@@ -4388,7 +4390,14 @@ public final class ViewRootImpl implements ViewParent,
            mReportNextDraw = false;
            mLastReportNextDrawReason = null;
            mActiveSurfaceSyncGroup = null;
            if (mHasPendingTransactions) {
                // TODO: We shouldn't ever actually hit this, it means mPendingTransaction wasn't
                // merged with a sync group or BLASTBufferQueue before making it to this point
                // But better a one or two frame flicker than steady-state broken from dropping
                // whatever is in this transaction
                mPendingTransaction.apply();
                mHasPendingTransactions = false;
            }
            mSyncBuffer = false;
            if (isInWMSRequestedSync()) {
                mWmsRequestSyncGroup.markSyncReady();
@@ -5305,6 +5314,7 @@ public final class ViewRootImpl implements ViewParent,
    private void registerCallbackForPendingTransactions() {
        Transaction t = new Transaction();
        t.merge(mPendingTransaction);
        mHasPendingTransactions = false;
        registerRtFrameCallback(new FrameDrawingCallback() {
            @Override
@@ -5384,6 +5394,7 @@ public final class ViewRootImpl implements ViewParent,
        if (!usingAsyncReport && mHasPendingTransactions) {
            pendingTransaction = new Transaction();
            pendingTransaction.merge(mPendingTransaction);
            mHasPendingTransactions = false;
        } else {
            pendingTransaction = null;
        }
@@ -9942,6 +9953,7 @@ public final class ViewRootImpl implements ViewParent,
        }
        handleSyncRequestWhenNoAsyncDraw(mActiveSurfaceSyncGroup, mHasPendingTransactions,
                mPendingTransaction, "shutting down VRI");
        mHasPendingTransactions = false;
        WindowManagerGlobal.getInstance().doRemoveView(this);
    }
@@ -12601,6 +12613,7 @@ public final class ViewRootImpl implements ViewParent,
        if (mHasPendingTransactions) {
            t = new Transaction();
            t.merge(mPendingTransaction);
            mHasPendingTransactions = false;
        } else {
            t = null;
        }