diff options
author | Dan Stoza <stoza@google.com> | 2015-06-02 15:45:22 -0700 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2015-06-03 11:09:33 -0700 |
commit | 812ed0644f8f8f71ca403f4e5793f0dbc1fcf9b2 (patch) | |
tree | ceb7515f9f4ded20808bdb322eb9af77366d0629 /include/ui | |
parent | a8c2454d52d3c23bd53b4a172eff8e5f4af30168 (diff) | |
download | frameworks_native-812ed0644f8f8f71ca403f4e5793f0dbc1fcf9b2.zip frameworks_native-812ed0644f8f8f71ca403f4e5793f0dbc1fcf9b2.tar.gz frameworks_native-812ed0644f8f8f71ca403f4e5793f0dbc1fcf9b2.tar.bz2 |
libgui: Add generation numbers to BufferQueue
This change allows producers to set a generation number on a
BufferQueue. This number will be embedded in any new GraphicBuffers
created in that BufferQueue, and attempts to attach buffers which have
a different generation number will fail.
It also plumbs the setGenerationNumber method through Surface, with the
additional effect that any buffers attached to the Surface after
setting a new generation number will automatically be updated with the
new number (as opposed to failing, as would happen on through IGBP).
Bug: 20923096
Change-Id: I32bf726b035f99c3e5834beaf76afb9f01adcbc2
Diffstat (limited to 'include/ui')
-rw-r--r-- | include/ui/GraphicBuffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index f91d192..3da720f 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -94,6 +94,11 @@ public: Rect getBounds() const { return Rect(width, height); } uint64_t getId() const { return mId; } + uint32_t getGenerationNumber() const { return mGenerationNumber; } + void setGenerationNumber(uint32_t generation) { + mGenerationNumber = generation; + } + status_t reallocate(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage); @@ -166,6 +171,11 @@ private: sp<ANativeWindowBuffer> mWrappedBuffer; uint64_t mId; + + // Stores the generation number of this buffer. If this number does not + // match the BufferQueue's internal generation number (set through + // IGBP::setGenerationNumber), attempts to attach the buffer will fail. + uint32_t mGenerationNumber; }; }; // namespace android |