From cedef0560eab55e767bd4a1f433ea30af301d8b7 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 22 Apr 2020 15:58:23 -0700 Subject: BLASTBufferQueue: Don't query for triple buffering Instead accept it as an argument so we can avoid calling property_get_bool over and over. Bug: 152501005 Test: Existing tests pass Change-Id: Ie06ed7940fe883c3182950508c2f3524bf28f702 --- libs/gui/BLASTBufferQueue.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/gui/BLASTBufferQueue.cpp') diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp index a8384accce..fd838b2b1c 100644 --- a/libs/gui/BLASTBufferQueue.cpp +++ b/libs/gui/BLASTBufferQueue.cpp @@ -95,7 +95,8 @@ void BLASTBufferItemConsumer::getConnectionEvents(uint64_t frameNumber, bool* ne if (needsDisconnect != nullptr) *needsDisconnect = disconnect; } -BLASTBufferQueue::BLASTBufferQueue(const sp& surface, int width, int height) +BLASTBufferQueue::BLASTBufferQueue(const sp& surface, int width, int height, + bool enableTripleBuffering) : mSurfaceControl(surface), mWidth(width), mHeight(height), @@ -105,8 +106,7 @@ BLASTBufferQueue::BLASTBufferQueue(const sp& surface, int width, // explicitly so that dequeueBuffer will block mProducer->setDequeueTimeout(std::numeric_limits::max()); - int8_t disableTripleBuffer = property_get_bool("ro.sf.disable_triple_buffer", 0); - if (!disableTripleBuffer) { + if (enableTripleBuffering) { mProducer->setMaxDequeuedBufferCount(2); } mBufferItemConsumer = -- cgit v1.2.3-59-g8ed1b