diff options
| author | 2017-03-22 15:49:32 -0700 | |
|---|---|---|
| committer | 2017-04-13 21:58:17 -0700 | |
| commit | 0556d79eacbf0c9978080d87aa4075120533c7ef (patch) | |
| tree | 9d3506abe0a55a50298b64d417947f1e5f8888a2 /libs/gui/BufferQueueProducer.cpp | |
| parent | 1011062e1ac5d0a15ae99108eed2add6c77c3e8f (diff) | |
get rid of IGraphicBufferAlloc
Buffers can now be allocated directly through
the graphic allocator HAL.
Test: marlin: run full camera cts
Test: angler: take screenshot, take photo w/ and w/o HDR, video, panorama, refocus, slo-mo
Bug: 36462585
Bug: 36333314
Change-Id: Ie5222c53c3b9462e0ac7a41568718aad131eb328
Diffstat (limited to 'libs/gui/BufferQueueProducer.cpp')
| -rw-r--r-- | libs/gui/BufferQueueProducer.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp index aef231a252..a540ab9468 100644 --- a/libs/gui/BufferQueueProducer.cpp +++ b/libs/gui/BufferQueueProducer.cpp @@ -34,7 +34,6 @@ #include <gui/BufferQueueProducer.h> #include <gui/GLConsumer.h> #include <gui/IConsumerListener.h> -#include <gui/IGraphicBufferAlloc.h> #include <gui/IProducerListener.h> #include <utils/Log.h> @@ -454,8 +453,7 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, mSlots[found].mBufferState.dequeue(); if ((buffer == NULL) || - buffer->needsReallocation(width, height, format, BQ_LAYER_COUNT, - usage)) + buffer->needsReallocation(width, height, format, BQ_LAYER_COUNT, usage)) { mSlots[found].mAcquireCalled = false; mSlots[found].mGraphicBuffer = NULL; @@ -503,11 +501,13 @@ status_t BufferQueueProducer::dequeueBuffer(int *outSlot, } // Autolock scope if (returnFlags & BUFFER_NEEDS_REALLOCATION) { - status_t error; BQ_LOGV("dequeueBuffer: allocating a new buffer for slot %d", *outSlot); - sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( - width, height, format, BQ_LAYER_COUNT, usage, - {mConsumerName.string(), mConsumerName.size()}, &error)); + sp<GraphicBuffer> graphicBuffer = new GraphicBuffer( + width, height, format, BQ_LAYER_COUNT, usage, usage, + {mConsumerName.string(), mConsumerName.size()}); + + status_t error = graphicBuffer->initCheck(); + { // Autolock scope Mutex::Autolock lock(mCore->mMutex); @@ -1337,11 +1337,12 @@ void BufferQueueProducer::allocateBuffers(uint32_t width, uint32_t height, Vector<sp<GraphicBuffer>> buffers; for (size_t i = 0; i < newBufferCount; ++i) { - status_t result = NO_ERROR; - sp<GraphicBuffer> graphicBuffer(mCore->mAllocator->createGraphicBuffer( + sp<GraphicBuffer> graphicBuffer = new GraphicBuffer( allocWidth, allocHeight, allocFormat, BQ_LAYER_COUNT, - allocUsage, {mConsumerName.string(), mConsumerName.size()}, - &result)); + allocUsage, allocUsage, {mConsumerName.string(), mConsumerName.size()}); + + status_t result = graphicBuffer->initCheck(); + if (result != NO_ERROR) { BQ_LOGE("allocateBuffers: failed to allocate buffer (%u x %u, format" " %u, usage %u)", width, height, format, usage); |