diff options
-rw-r--r-- | cmds/flatland/GLHelper.cpp | 3 | ||||
-rw-r--r-- | cmds/flatland/GLHelper.h | 3 | ||||
-rw-r--r-- | include/gui/BufferQueue.h | 3 | ||||
-rw-r--r-- | include/gui/BufferQueueCore.h | 2 | ||||
-rw-r--r-- | libs/gui/BufferQueue.cpp | 5 | ||||
-rw-r--r-- | libs/gui/BufferQueueCore.cpp | 15 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 6 |
7 files changed, 14 insertions, 23 deletions
diff --git a/cmds/flatland/GLHelper.cpp b/cmds/flatland/GLHelper.cpp index ddf3aa8686..1a1c9a3027 100644 --- a/cmds/flatland/GLHelper.cpp +++ b/cmds/flatland/GLHelper.cpp @@ -25,7 +25,6 @@ namespace android { GLHelper::GLHelper() : - mGraphicBufferAlloc(new GraphicBufferAlloc()), mDisplay(EGL_NO_DISPLAY), mContext(EGL_NO_CONTEXT), mDummySurface(EGL_NO_SURFACE), @@ -203,7 +202,7 @@ bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h, sp<GLConsumer>* glConsumer, EGLSurface* surface) { sp<IGraphicBufferProducer> producer; sp<IGraphicBufferConsumer> consumer; - BufferQueue::createBufferQueue(&producer, &consumer, mGraphicBufferAlloc); + BufferQueue::createBufferQueue(&producer, &consumer); sp<GLConsumer> glc = new GLConsumer(consumer, name, GL_TEXTURE_EXTERNAL_OES, false, true); glc->setDefaultBufferSize(w, h); diff --git a/cmds/flatland/GLHelper.h b/cmds/flatland/GLHelper.h index 7a9e9e3ea2..d09463a9b8 100644 --- a/cmds/flatland/GLHelper.h +++ b/cmds/flatland/GLHelper.h @@ -14,7 +14,6 @@ * limitations under the License. */ -#include <gui/GraphicBufferAlloc.h> #include <gui/GLConsumer.h> #include <gui/Surface.h> #include <gui/SurfaceControl.h> @@ -75,8 +74,6 @@ private: bool setUpShaders(const ShaderDesc* shaderDescs, size_t numShaders); - sp<GraphicBufferAlloc> mGraphicBufferAlloc; - EGLDisplay mDisplay; EGLContext mContext; EGLSurface mDummySurface; diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h index 09300a20c9..c48ffb4eb2 100644 --- a/include/gui/BufferQueue.h +++ b/include/gui/BufferQueue.h @@ -76,8 +76,7 @@ public: // producers and consumers. allocator is used to allocate all the // needed gralloc buffers. static void createBufferQueue(sp<IGraphicBufferProducer>* outProducer, - sp<IGraphicBufferConsumer>* outConsumer, - const sp<IGraphicBufferAlloc>& allocator = NULL); + sp<IGraphicBufferConsumer>* outConsumer); private: BufferQueue(); // Create through createBufferQueue diff --git a/include/gui/BufferQueueCore.h b/include/gui/BufferQueueCore.h index fbd5114c1d..4a6471e2e6 100644 --- a/include/gui/BufferQueueCore.h +++ b/include/gui/BufferQueueCore.h @@ -75,7 +75,7 @@ public: // BufferQueueCore manages a pool of gralloc memory slots to be used by // producers and consumers. allocator is used to allocate all the needed // gralloc buffers. - BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator = NULL); + BufferQueueCore(); virtual ~BufferQueueCore(); private: diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp index ccbb5a25f3..61da85f77c 100644 --- a/libs/gui/BufferQueue.cpp +++ b/libs/gui/BufferQueue.cpp @@ -62,14 +62,13 @@ void BufferQueue::ProxyConsumerListener::onSidebandStreamChanged() { } void BufferQueue::createBufferQueue(sp<IGraphicBufferProducer>* outProducer, - sp<IGraphicBufferConsumer>* outConsumer, - const sp<IGraphicBufferAlloc>& allocator) { + sp<IGraphicBufferConsumer>* outConsumer) { 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)); + sp<BufferQueueCore> core(new BufferQueueCore()); LOG_ALWAYS_FATAL_IF(core == NULL, "BufferQueue: failed to create BufferQueueCore"); diff --git a/libs/gui/BufferQueueCore.cpp b/libs/gui/BufferQueueCore.cpp index c24ad19897..d005d5000e 100644 --- a/libs/gui/BufferQueueCore.cpp +++ b/libs/gui/BufferQueueCore.cpp @@ -38,8 +38,8 @@ static String8 getUniqueName() { android_atomic_inc(&counter)); } -BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : - mAllocator(allocator), +BufferQueueCore::BufferQueueCore() : + mAllocator(), mMutex(), mIsAbandoned(false), mConsumerControlledByApp(false), @@ -75,13 +75,12 @@ BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : mSingleBufferCache(Rect::INVALID_RECT, 0, NATIVE_WINDOW_SCALING_MODE_FREEZE, HAL_DATASPACE_UNKNOWN) { - if (allocator == NULL) { - sp<ISurfaceComposer> composer(ComposerService::getComposerService()); - mAllocator = composer->createGraphicBufferAlloc(); - if (mAllocator == NULL) { - BQ_LOGE("createGraphicBufferAlloc failed"); - } + sp<ISurfaceComposer> composer(ComposerService::getComposerService()); + mAllocator = composer->createGraphicBufferAlloc(); + if (mAllocator == NULL) { + BQ_LOGE("createGraphicBufferAlloc failed"); } + for (int slot = 0; slot < BufferQueueDefs::NUM_BUFFER_SLOTS; ++slot) { mFreeSlots.insert(slot); } diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 1e33847406..66c2251c80 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -483,8 +483,7 @@ void SurfaceFlinger::init() { sp<IGraphicBufferProducer> producer; sp<IGraphicBufferConsumer> consumer; - BufferQueue::createBufferQueue(&producer, &consumer, - new GraphicBufferAlloc()); + BufferQueue::createBufferQueue(&producer, &consumer); sp<FramebufferSurface> fbs = new FramebufferSurface(*mHwc, i, consumer); @@ -1436,8 +1435,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) sp<IGraphicBufferProducer> producer; sp<IGraphicBufferProducer> bqProducer; sp<IGraphicBufferConsumer> bqConsumer; - BufferQueue::createBufferQueue(&bqProducer, &bqConsumer, - new GraphicBufferAlloc()); + BufferQueue::createBufferQueue(&bqProducer, &bqConsumer); int32_t hwcDisplayId = -1; if (state.isVirtualDisplay()) { |