summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueue.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2014-04-07 16:33:59 -0700
committer Dan Stoza <stoza@google.com> 2014-04-07 17:00:26 -0700
commitb3d0bdf0dbc19f0a0d7d924693025371e24828fd (patch)
tree283a71a3cfe5940fb0b3385e657c1b16f7048867 /libs/gui/BufferQueue.cpp
parentfc9aeb859096cc02ec9241fad589d361cf9c3ddd (diff)
BufferQueue: Remove Bn version of create*
It turns out that there's no reason to have both I* and Bn* versions of the createBufferQueue method, so I removed the Bn* version. Change-Id: I66aeb09e10458ae540ddf1f38d2d0154ea8f315b
Diffstat (limited to 'libs/gui/BufferQueue.cpp')
-rw-r--r--libs/gui/BufferQueue.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index c306f9d651..782afcc9c8 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -43,19 +43,6 @@ void BufferQueue::ProxyConsumerListener::onBuffersReleased() {
}
}
-void BufferQueue::createBufferQueue(sp<BnGraphicBufferProducer>* outProducer,
- sp<BnGraphicBufferConsumer>* outConsumer,
- const sp<IGraphicBufferAlloc>& allocator) {
- LOG_ALWAYS_FATAL_IF(outProducer == NULL,
- "BufferQueue: outProducer must not be NULL");
- LOG_ALWAYS_FATAL_IF(outConsumer == NULL,
- "BufferQueue: outConsumer must not be NULL");
-
- sp<BufferQueueCore> core(new BufferQueueCore(allocator));
- *outProducer = new BufferQueueProducer(core);
- *outConsumer = new BufferQueueConsumer(core);
-}
-
void BufferQueue::createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
sp<IGraphicBufferConsumer>* outConsumer,
const sp<IGraphicBufferAlloc>& allocator) {
@@ -65,8 +52,19 @@ void BufferQueue::createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
"BufferQueue: outConsumer must not be NULL");
sp<BufferQueueCore> core(new BufferQueueCore(allocator));
- *outProducer = new BufferQueueProducer(core);
- *outConsumer = new BufferQueueConsumer(core);
+ LOG_ALWAYS_FATAL_IF(core == NULL,
+ "BufferQueue: failed to create BufferQueueCore");
+
+ sp<IGraphicBufferProducer> producer(new BufferQueueProducer(core));
+ LOG_ALWAYS_FATAL_IF(producer == NULL,
+ "BufferQueue: failed to create BufferQueueProducer");
+
+ sp<IGraphicBufferConsumer> consumer(new BufferQueueConsumer(core));
+ LOG_ALWAYS_FATAL_IF(consumer == NULL,
+ "BufferQueue: failed to create BufferQueueConsumer");
+
+ *outProducer = producer;
+ *outConsumer = consumer;
}
BufferQueue::BufferQueue(const sp<IGraphicBufferAlloc>& allocator) :