From a1c4c829a1ac5fd2a5ae583424fd35ae7a9a292c Mon Sep 17 00:00:00 2001 From: chaviw Date: Wed, 10 Nov 2021 18:11:58 -0600 Subject: Rename nextTransaction to syncTransaction The variable nextTransaction is abigious and doesn't represent its purpose. Rename to syncTransaction Test: BLASTBufferQueueTest Bug: 200285149 Change-Id: I1c1e151a63e88127178a92a369e82bcc6770ab90 --- libs/gui/BLASTBufferQueue.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'libs/gui/BLASTBufferQueue.cpp') diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index 9080822f92..e9149f3a3e 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -138,7 +138,7 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, const sp= mLastAcquiredFrameNumber) { mWaitForTransactionCallback = false; flushShadowQueue(); @@ -420,7 +420,7 @@ void BLASTBufferQueue::releaseBufferCallback( mBufferItemConsumer->releaseBuffer(it->second, releaseBuffer.releaseFence); mSubmitted.erase(it); // Don't process the transactions here if mWaitForTransactionCallback is set. Instead, let - // onFrameAvailable handle processing them since it will merge with the nextTransaction. + // onFrameAvailable handle processing them since it will merge with the syncTransaction. if (!mWaitForTransactionCallback) { acquireNextBufferLocked(std::nullopt); } @@ -593,15 +593,15 @@ void BLASTBufferQueue::onFrameAvailable(const BufferItem& item) { ATRACE_CALL(); std::unique_lock _lock{mMutex}; - const bool nextTransactionSet = mNextTransaction != nullptr; - BQA_LOGV("onFrameAvailable-start nextTransactionSet=%s", boolToString(nextTransactionSet)); - if (nextTransactionSet) { + const bool syncTransactionSet = mSyncTransaction != nullptr; + BQA_LOGV("onFrameAvailable-start syncTransactionSet=%s", boolToString(syncTransactionSet)); + if (syncTransactionSet) { if (mWaitForTransactionCallback) { // We are waiting on a previous sync's transaction callback so allow another sync // transaction to proceed. // // We need to first flush out the transactions that were in between the two syncs. - // We do this by merging them into mNextTransaction so any buffer merging will get + // We do this by merging them into mSyncTransaction so any buffer merging will get // a release callback invoked. The release callback will be async so we need to wait // on max acquired to make sure we have the capacity to acquire another buffer. if (maxBuffersAcquired(false /* includeExtraAcquire */)) { @@ -625,12 +625,12 @@ void BLASTBufferQueue::onFrameAvailable(const BufferItem& item) { ATRACE_INT(mQueuedBufferTrace.c_str(), mNumFrameAvailable + mNumAcquired - mPendingRelease.size()); - BQA_LOGV("onFrameAvailable framenumber=%" PRIu64 " nextTransactionSet=%s", item.mFrameNumber, - boolToString(nextTransactionSet)); + BQA_LOGV("onFrameAvailable framenumber=%" PRIu64 " syncTransactionSet=%s", item.mFrameNumber, + boolToString(syncTransactionSet)); - if (nextTransactionSet) { - acquireNextBufferLocked(std::move(mNextTransaction)); - mNextTransaction = nullptr; + if (syncTransactionSet) { + acquireNextBufferLocked(std::move(mSyncTransaction)); + mSyncTransaction = nullptr; mWaitForTransactionCallback = true; } else if (!mWaitForTransactionCallback) { acquireNextBufferLocked(std::nullopt); @@ -652,9 +652,9 @@ void BLASTBufferQueue::onFrameCancelled(const uint64_t bufferId) { mDequeueTimestamps.erase(bufferId); }; -void BLASTBufferQueue::setNextTransaction(SurfaceComposerClient::Transaction* t) { +void BLASTBufferQueue::setSyncTransaction(SurfaceComposerClient::Transaction* t) { std::lock_guard _lock{mMutex}; - mNextTransaction = t; + mSyncTransaction = t; } bool BLASTBufferQueue::rejectBuffer(const BufferItem& item) { -- cgit v1.2.3-59-g8ed1b