diff options
author | Dan Stoza <stoza@google.com> | 2014-06-30 17:38:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-27 15:56:14 +0000 |
commit | dc56bf721a9f29621fd57e1d861142fa9b2d3663 (patch) | |
tree | 798493ee885dbc05107019a2c5b2bb97616f07c4 /include | |
parent | ff0d588db52e29cf679d10c53affea9b8d867f26 (diff) | |
parent | 29a3e90879fd96404c971e7187cd0e05927bbce0 (diff) | |
download | frameworks_native-dc56bf721a9f29621fd57e1d861142fa9b2d3663.zip frameworks_native-dc56bf721a9f29621fd57e1d861142fa9b2d3663.tar.gz frameworks_native-dc56bf721a9f29621fd57e1d861142fa9b2d3663.tar.bz2 |
Merge "BufferQueue: Add allocateBuffers method"
Diffstat (limited to 'include')
-rw-r--r-- | include/gui/BufferQueueProducer.h | 4 | ||||
-rw-r--r-- | include/gui/IGraphicBufferProducer.h | 13 | ||||
-rw-r--r-- | include/gui/Surface.h | 10 |
3 files changed, 27 insertions, 0 deletions
diff --git a/include/gui/BufferQueueProducer.h b/include/gui/BufferQueueProducer.h index 9df3633..fe8a308 100644 --- a/include/gui/BufferQueueProducer.h +++ b/include/gui/BufferQueueProducer.h @@ -169,6 +169,10 @@ public: // handle if any. virtual status_t setSidebandStream(const sp<NativeHandle>& stream); + // See IGraphicBufferProducer::allocateBuffers + virtual void allocateBuffers(bool async, uint32_t width, uint32_t height, + uint32_t format, uint32_t usage); + private: // This is required by the IBinder::DeathRecipient interface virtual void binderDied(const wp<IBinder>& who); diff --git a/include/gui/IGraphicBufferProducer.h b/include/gui/IGraphicBufferProducer.h index d9e116b..9b96b2b 100644 --- a/include/gui/IGraphicBufferProducer.h +++ b/include/gui/IGraphicBufferProducer.h @@ -429,6 +429,19 @@ public: // Passing NULL or a different stream handle will detach the previous // handle if any. virtual status_t setSidebandStream(const sp<NativeHandle>& stream) = 0; + + // Allocates buffers based on the given dimensions/format. + // + // This function will allocate up to the maximum number of buffers + // permitted by the current BufferQueue configuration. It will use the + // given format, dimensions, and usage bits, which are interpreted in the + // same way as for dequeueBuffer, and the async flag must be set the same + // way as for dequeueBuffer to ensure that the correct number of buffers are + // allocated. This is most useful to avoid an allocation delay during + // dequeueBuffer. If there are already the maximum number of buffers + // allocated, this function has no effect. + virtual void allocateBuffers(bool async, uint32_t width, uint32_t height, + uint32_t format, uint32_t usage) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/gui/Surface.h b/include/gui/Surface.h index d8e9756..dcfe74f 100644 --- a/include/gui/Surface.h +++ b/include/gui/Surface.h @@ -91,6 +91,16 @@ public: */ void setSidebandStream(const sp<NativeHandle>& stream); + /* Allocates buffers based on the current dimensions/format. + * + * This function will allocate up to the maximum number of buffers + * permitted by the current BufferQueue configuration. It will use the + * default format and dimensions. This is most useful to avoid an allocation + * delay during dequeueBuffer. If there are already the maximum number of + * buffers allocated, this function has no effect. + */ + void allocateBuffers(); + protected: virtual ~Surface(); |