diff options
author | Mathias Agopian <mathias@google.com> | 2012-06-07 17:52:54 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2012-06-13 18:07:47 -0700 |
commit | 3e87601170141229d661df93e2f59e1ced73474b (patch) | |
tree | e079df58541938d0854cabb2a1394c221a2dc98f /libs | |
parent | 04d7eaf138678ef591076ff02b896f93394bcfaf (diff) | |
download | frameworks_native-3e87601170141229d661df93e2f59e1ced73474b.zip frameworks_native-3e87601170141229d661df93e2f59e1ced73474b.tar.gz frameworks_native-3e87601170141229d661df93e2f59e1ced73474b.tar.bz2 |
Implement SurfaceFlinger's ANW on top of BufferQueue
SF now has its own implementation of ANW for the
framebuffer and it uses BufferQueue. FramebufferNativeWindow
is now only used by stand-alone apps.
Change-Id: Iddeb24087df62bd92b0f78e391dda9b97ddc859c
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/BufferQueue.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp index a0774cf..a2e08c0 100644 --- a/libs/gui/BufferQueue.cpp +++ b/libs/gui/BufferQueue.cpp @@ -81,7 +81,8 @@ static const char* scalingModeName(int scalingMode) { } } -BufferQueue::BufferQueue( bool allowSynchronousMode, int bufferCount ) : +BufferQueue::BufferQueue(bool allowSynchronousMode, int bufferCount, + const sp<IGraphicBufferAlloc>& allocator) : mDefaultWidth(1), mDefaultHeight(1), mPixelFormat(PIXEL_FORMAT_RGBA_8888), @@ -105,10 +106,14 @@ BufferQueue::BufferQueue( bool allowSynchronousMode, int bufferCount ) : mConsumerName = String8::format("unnamed-%d-%d", getpid(), createProcessUniqueId()); ST_LOGV("BufferQueue"); - sp<ISurfaceComposer> composer(ComposerService::getComposerService()); - mGraphicBufferAlloc = composer->createGraphicBufferAlloc(); - if (mGraphicBufferAlloc == 0) { - ST_LOGE("createGraphicBufferAlloc() failed in BufferQueue()"); + if (allocator == NULL) { + sp<ISurfaceComposer> composer(ComposerService::getComposerService()); + mGraphicBufferAlloc = composer->createGraphicBufferAlloc(); + if (mGraphicBufferAlloc == 0) { + ST_LOGE("createGraphicBufferAlloc() failed in BufferQueue()"); + } + } else { + mGraphicBufferAlloc = allocator; } } |