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

Commit af5e2e16 authored by Valerie Hau's avatar Valerie Hau Committed by Gerrit Code Review
Browse files

Merge "[RESTRICT AUTOMERGE] Send callbacks earlier"

parents 898879b9 7687b3cd
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -2159,6 +2159,16 @@ void SurfaceFlinger::postComposition()
        }
    });

    mTransactionCompletedThread.addPresentFence(mPreviousPresentFences[0]);

    // Lock the mStateLock in case SurfaceFlinger is in the middle of applying a transaction.
    // If we do not lock here, a callback could be sent without all of its SurfaceControls and
    // metrics.
    {
        Mutex::Autolock _l(mStateLock);
        mTransactionCompletedThread.sendCallbacks();
    }

    if (presentFenceTime->isValid()) {
        mScheduler->addPresentFence(presentFenceTime);
    }
@@ -2230,16 +2240,6 @@ void SurfaceFlinger::postComposition()
        }
    }

    mTransactionCompletedThread.addPresentFence(mPreviousPresentFences[0]);

    // Lock the mStateLock in case SurfaceFlinger is in the middle of applying a transaction.
    // If we do not lock here, a callback could be sent without all of its SurfaceControls and
    // metrics.
    {
        Mutex::Autolock _l(mStateLock);
        mTransactionCompletedThread.sendCallbacks();
    }

    if (mLumaSampling && mRegionSamplingThread) {
        mRegionSamplingThread->notifyNewContent();
    }