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
diff --git a/libs/gui/BLASTBufferQueue.cpp b/libs/gui/BLASTBufferQueue.cpp
index a8384ac..fd838b2 100644
--- a/libs/gui/BLASTBufferQueue.cpp
+++ b/libs/gui/BLASTBufferQueue.cpp
@@ -95,7 +95,8 @@
if (needsDisconnect != nullptr) *needsDisconnect = disconnect;
}
-BLASTBufferQueue::BLASTBufferQueue(const sp<SurfaceControl>& surface, int width, int height)
+BLASTBufferQueue::BLASTBufferQueue(const sp<SurfaceControl>& surface, int width, int height,
+ bool enableTripleBuffering)
: mSurfaceControl(surface),
mWidth(width),
mHeight(height),
@@ -105,8 +106,7 @@
// explicitly so that dequeueBuffer will block
mProducer->setDequeueTimeout(std::numeric_limits<int64_t>::max());
- int8_t disableTripleBuffer = property_get_bool("ro.sf.disable_triple_buffer", 0);
- if (!disableTripleBuffer) {
+ if (enableTripleBuffering) {
mProducer->setMaxDequeuedBufferCount(2);
}
mBufferItemConsumer =