diff options
author | Mathias Agopian <mathias@google.com> | 2011-03-31 19:10:24 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-04-01 14:43:35 -0700 |
commit | e5a1bffd9106b1d82259de1a202e1f2f28742392 (patch) | |
tree | 5db6b7eb4b1b32395aae1950e2bcec1c6a80fd4d /include/gui/SurfaceTexture.h | |
parent | 616fb9a38a5b558b1245b0e7f6dc0c4e5ef1a985 (diff) | |
download | frameworks_base-e5a1bffd9106b1d82259de1a202e1f2f28742392.zip frameworks_base-e5a1bffd9106b1d82259de1a202e1f2f28742392.tar.gz frameworks_base-e5a1bffd9106b1d82259de1a202e1f2f28742392.tar.bz2 |
SurfaceTexture can now force the client to request a buffer
SurfaceTexture now has the concept of default size a new method,
setDefaultBufferSize() to set it. When the default size is
changed, dequeueBuffer() will return a value telling the
client that it must ask for a new buffer.
The above only applies if the client has not
overriden the buffer size with setGeometry.
Change-Id: I520dc40363054b7e37fdb67d6a2e7bce70326e81
Diffstat (limited to 'include/gui/SurfaceTexture.h')
-rw-r--r-- | include/gui/SurfaceTexture.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h index afa64d3..585d288 100644 --- a/include/gui/SurfaceTexture.h +++ b/include/gui/SurfaceTexture.h @@ -121,6 +121,12 @@ public: // buffers before the client is done with them. sp<IBinder> getAllocator(); + // setDefaultBufferSize is used to set the size of buffers returned by + // requestBuffers when a with and height of zero is requested. + // A call to setDefaultBufferSize() may trigger requestBuffers() to + // be called from the client. + status_t setDefaultBufferSize(uint32_t w, uint32_t h); + private: // freeAllBuffers frees the resources (both GraphicBuffer and EGLImage) for @@ -158,6 +164,23 @@ private: // for a slot when requestBuffer is called with that slot's index. BufferSlot mSlots[NUM_BUFFER_SLOTS]; + // mDefaultWidth holds the default width of allocated buffers. It is used + // in requestBuffers() if a width and height of zero is specified. + uint32_t mDefaultWidth; + + // mDefaultHeight holds the default height of allocated buffers. It is used + // in requestBuffers() if a width and height of zero is specified. + uint32_t mDefaultHeight; + + // mPixelFormat holds the pixel format of allocated buffers. It is used + // in requestBuffers() if a format of zero is specified. + uint32_t mPixelFormat; + + // mUseDefaultSize indicates whether or not the default size should be used + // that is, if the last requestBuffer has been called with both width + // and height null. + bool mUseDefaultSize; + // mBufferCount is the number of buffer slots that the client and server // must maintain. It defaults to MIN_BUFFER_SLOTS and can be changed by // calling setBufferCount. |