Loading services/surfaceflinger/SurfaceFlinger.cpp +30 −22 Original line number Diff line number Diff line Loading @@ -3520,24 +3520,31 @@ uint32_t SurfaceFlinger::setTransactionFlags(uint32_t flags, } bool SurfaceFlinger::flushTransactionQueues() { Mutex::Autolock _l(mStateLock); // to prevent onHandleDestroyed from being called while the lock is held, // we must keep a copy of the transactions (specifically the composer // states) around outside the scope of the lock std::vector<const TransactionState> transactions; bool flushedATransaction = false; { Mutex::Autolock _l(mStateLock); auto it = mTransactionQueues.begin(); while (it != mTransactionQueues.end()) { auto& [applyToken, transactionQueue] = *it; while (!transactionQueue.empty()) { const auto& [states, displays, flags, desiredPresentTime, uncacheBuffer, listenerCallbacks, postTime, privileged] = transactionQueue.front(); if (!transactionIsReadyToBeApplied(desiredPresentTime, states)) { const auto& transaction = transactionQueue.front(); if (!transactionIsReadyToBeApplied(transaction.desiredPresentTime, transaction.states)) { setTransactionFlags(eTransactionFlushNeeded); break; } applyTransactionState(states, displays, flags, mPendingInputWindowCommands, desiredPresentTime, uncacheBuffer, listenerCallbacks, postTime, privileged, /*isMainThread*/ true); transactions.push_back(transaction); applyTransactionState(transaction.states, transaction.displays, transaction.flags, mPendingInputWindowCommands, transaction.desiredPresentTime, transaction.buffer, transaction.callback, transaction.postTime, transaction.privileged, /*isMainThread*/ true); transactionQueue.pop(); flushedATransaction = true; } Loading @@ -3549,6 +3556,7 @@ bool SurfaceFlinger::flushTransactionQueues() { std::next(it, 1); } } } return flushedATransaction; } Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +30 −22 Original line number Diff line number Diff line Loading @@ -3520,24 +3520,31 @@ uint32_t SurfaceFlinger::setTransactionFlags(uint32_t flags, } bool SurfaceFlinger::flushTransactionQueues() { Mutex::Autolock _l(mStateLock); // to prevent onHandleDestroyed from being called while the lock is held, // we must keep a copy of the transactions (specifically the composer // states) around outside the scope of the lock std::vector<const TransactionState> transactions; bool flushedATransaction = false; { Mutex::Autolock _l(mStateLock); auto it = mTransactionQueues.begin(); while (it != mTransactionQueues.end()) { auto& [applyToken, transactionQueue] = *it; while (!transactionQueue.empty()) { const auto& [states, displays, flags, desiredPresentTime, uncacheBuffer, listenerCallbacks, postTime, privileged] = transactionQueue.front(); if (!transactionIsReadyToBeApplied(desiredPresentTime, states)) { const auto& transaction = transactionQueue.front(); if (!transactionIsReadyToBeApplied(transaction.desiredPresentTime, transaction.states)) { setTransactionFlags(eTransactionFlushNeeded); break; } applyTransactionState(states, displays, flags, mPendingInputWindowCommands, desiredPresentTime, uncacheBuffer, listenerCallbacks, postTime, privileged, /*isMainThread*/ true); transactions.push_back(transaction); applyTransactionState(transaction.states, transaction.displays, transaction.flags, mPendingInputWindowCommands, transaction.desiredPresentTime, transaction.buffer, transaction.callback, transaction.postTime, transaction.privileged, /*isMainThread*/ true); transactionQueue.pop(); flushedATransaction = true; } Loading @@ -3549,6 +3556,7 @@ bool SurfaceFlinger::flushTransactionQueues() { std::next(it, 1); } } } return flushedATransaction; } Loading