diff options
author | 2025-02-12 03:39:54 -0800 | |
---|---|---|
committer | 2025-02-12 03:40:44 -0800 | |
commit | a576ccd2e572fead186fefdcc93f36960004461c (patch) | |
tree | cdf4032714211db01a1efbc0156b773a98f723d9 /libs/gui/BLASTBufferQueue.cpp | |
parent | c8ca54a3fa4c989489546fe919bb93295928ff9d (diff) |
Unify the types of two NumFrame variables and Code Optimization
1.For code portability and stability, it is recommended to define both variables as int32_t so that the sizes of the two variables are fixed regardless of the platform.
2.The two variables mNumAcquired and mNumFrameAvailable are initialized to 0 when declared in the header file. It is recommended to remove the re-initialization of these two values in the BBQ constructor of the source file.
Signed-off-by:
Shuangxi Xiang <xiangshuangxi@xiaomi.corp-partner.google.com>
Change-Id: I7cb525e62d1005b2a67cceb8e3efe0e3236506db
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
-rw-r--r-- | libs/gui/BLASTBufferQueue.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index 25e6a52ed1..ba82046388 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -210,8 +210,6 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, bool updateDestinati ComposerServiceAIDL::getComposerService()->getMaxAcquiredBufferCount(&mMaxAcquiredBuffers); mBufferItemConsumer->setMaxAcquiredBufferCount(mMaxAcquiredBuffers); mCurrentMaxAcquiredBufferCount = mMaxAcquiredBuffers; - mNumAcquired = 0; - mNumFrameAvailable = 0; TransactionCompletedListener::getInstance()->addQueueStallListener( [&](const std::string& reason) { @@ -436,7 +434,7 @@ void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence void BLASTBufferQueue::flushShadowQueue() { BQA_LOGV("flushShadowQueue"); - int numFramesToFlush = mNumFrameAvailable; + int32_t numFramesToFlush = mNumFrameAvailable; while (numFramesToFlush > 0) { acquireNextBufferLocked(std::nullopt); numFramesToFlush--; |