From a576ccd2e572fead186fefdcc93f36960004461c Mon Sep 17 00:00:00 2001 From: Shuangxi Xiang Date: Wed, 12 Feb 2025 03:39:54 -0800 Subject: 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 Change-Id: I7cb525e62d1005b2a67cceb8e3efe0e3236506db --- libs/gui/BLASTBufferQueue.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libs/gui/BLASTBufferQueue.cpp') 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 0) { acquireNextBufferLocked(std::nullopt); numFramesToFlush--; -- cgit v1.2.3-59-g8ed1b