[RESTRICT AUTOMERGE] Send callbacks earlier am: 7687b3cd32

Change-Id: I70078b1a443d34d361257885c9b6eaa05e763640
This commit is contained in:
Valerie Hau 2020-04-22 23:07:14 +00:00 committed by Automerger Merge Worker
commit 14df9a0d03

View file

@ -2092,6 +2092,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);
}
@ -2163,16 +2173,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();
}