Skip to content

Commit a576ccd

Browse files
author
Shuangxi Xiang
committed
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
1 parent c8ca54a commit a576ccd

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

libs/gui/BLASTBufferQueue.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ BLASTBufferQueue::BLASTBufferQueue(const std::string& name, bool updateDestinati
210210
ComposerServiceAIDL::getComposerService()->getMaxAcquiredBufferCount(&mMaxAcquiredBuffers);
211211
mBufferItemConsumer->setMaxAcquiredBufferCount(mMaxAcquiredBuffers);
212212
mCurrentMaxAcquiredBufferCount = mMaxAcquiredBuffers;
213-
mNumAcquired = 0;
214-
mNumFrameAvailable = 0;
215213

216214
TransactionCompletedListener::getInstance()->addQueueStallListener(
217215
[&](const std::string& reason) {
@@ -436,7 +434,7 @@ void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence
436434

437435
void BLASTBufferQueue::flushShadowQueue() {
438436
BQA_LOGV("flushShadowQueue");
439-
int numFramesToFlush = mNumFrameAvailable;
437+
int32_t numFramesToFlush = mNumFrameAvailable;
440438
while (numFramesToFlush > 0) {
441439
acquireNextBufferLocked(std::nullopt);
442440
numFramesToFlush--;

0 commit comments

Comments
 (0)