diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gui/BufferQueue.h | 10 | ||||
-rw-r--r-- | include/gui/IGraphicBufferAlloc.h | 3 | ||||
-rw-r--r-- | include/gui/ISurfaceTexture.h | 10 | ||||
-rw-r--r-- | include/gui/SurfaceTextureClient.h | 13 | ||||
-rw-r--r-- | include/ui/GraphicBuffer.h | 13 | ||||
-rw-r--r-- | include/ui/GraphicBufferAllocator.h | 5 |
6 files changed, 51 insertions, 3 deletions
diff --git a/include/gui/BufferQueue.h b/include/gui/BufferQueue.h index 9e265ba..02598b0 100644 --- a/include/gui/BufferQueue.h +++ b/include/gui/BufferQueue.h @@ -148,6 +148,16 @@ public: // The default mode is asynchronous. virtual status_t setSynchronousMode(bool enabled); +#ifdef QCOM_BSP + // setBufferSize enables us to specify user defined sizes for the buffers + // that need to be allocated by surfaceflinger for its client. This is + // useful for cases where the client doesn't want the gralloc to calculate + // buffer size. client should reset this value to 0, if it wants gralloc + // to calculate the size for the buffer. this will take effect from next + // dequeue buffer. + virtual status_t setBuffersSize(int size); +#endif + // connect attempts to connect a producer client API to the BufferQueue. // This must be called before any other ISurfaceTexture methods are called // except for getAllocator. diff --git a/include/gui/IGraphicBufferAlloc.h b/include/gui/IGraphicBufferAlloc.h index cee41d9..adc0b7f 100644 --- a/include/gui/IGraphicBufferAlloc.h +++ b/include/gui/IGraphicBufferAlloc.h @@ -38,6 +38,9 @@ public: */ virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, status_t* error) = 0; +#ifdef QCOM_BSP + virtual void setGraphicBufferSize(int size) = 0; +#endif }; // ---------------------------------------------------------------------------- diff --git a/include/gui/ISurfaceTexture.h b/include/gui/ISurfaceTexture.h index ae7c5c2..f0beab6 100644 --- a/include/gui/ISurfaceTexture.h +++ b/include/gui/ISurfaceTexture.h @@ -164,6 +164,16 @@ public: // The default mode is asynchronous. virtual status_t setSynchronousMode(bool enabled) = 0; +#ifdef QCOM_BSP + // setBufferSize enables to specify the user defined size of the buffer + // that needs to be allocated by surfaceflinger for its client. This is + // useful for cases where the client doesn't want the gralloc to calculate + // buffer size. client should reset this value to 0, if it wants gralloc to + // calculate the size for the buffer. this will take effect from next + // dequeue buffer. + virtual status_t setBuffersSize(int size) = 0; +#endif + // connect attempts to connect a client API to the SurfaceTexture. This // must be called before any other ISurfaceTexture methods are called except // for getAllocator. diff --git a/include/gui/SurfaceTextureClient.h b/include/gui/SurfaceTextureClient.h index 50fd1ba..108126d 100644 --- a/include/gui/SurfaceTextureClient.h +++ b/include/gui/SurfaceTextureClient.h @@ -93,6 +93,9 @@ private: int dispatchSetCrop(va_list args); int dispatchSetPostTransformCrop(va_list args); int dispatchSetUsage(va_list args); +#ifdef QCOM_BSP + int dispatchSetBuffersSize(va_list args); +#endif int dispatchLock(va_list args); int dispatchUnlockAndPost(va_list args); @@ -103,7 +106,9 @@ protected: virtual int perform(int operation, va_list args); virtual int query(int what, int* value) const; virtual int setSwapInterval(int interval); - +#ifdef QCOM_BSP + virtual int setBuffersSize(int size); +#endif virtual int lockBuffer_DEPRECATED(ANativeWindowBuffer* buffer); virtual int connect(int api); @@ -161,6 +166,12 @@ private: // at the next deuque operation. It is initialized to 0. uint32_t mReqUsage; +#ifdef QCOM_BSP + // mReqSize is the size of the buffer that will be requested + // at the next dequeue operation. It is initialized to 0. + uint32_t mReqSize; +#endif + // mTimestamp is the timestamp that will be used for the next buffer queue // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that // a timestamp is auto-generated when queueBuffer is called. diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index 1c84d0e..60bbf18 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -72,6 +72,12 @@ public: GraphicBuffer(); +#ifdef QCOM_BSP + // creates buffer of bufferSize + GraphicBuffer(uint32_t w, uint32_t h, + PixelFormat format, uint32_t usage, uint32_t bufferSize); +#endif + // creates w * h buffer GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); @@ -133,9 +139,12 @@ private: GraphicBuffer& operator = (const GraphicBuffer& rhs); const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; - status_t initSize(uint32_t w, uint32_t h, PixelFormat format, + status_t initSize(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); - +#ifdef QCOM_BSP + status_t initSize(uint32_t w, uint32_t h, PixelFormat format, + uint32_t usage, uint32_t bufferSize); +#endif void free_handle(); // Flattenable interface diff --git a/include/ui/GraphicBufferAllocator.h b/include/ui/GraphicBufferAllocator.h index 6342aac..a4d5b8c 100644 --- a/include/ui/GraphicBufferAllocator.h +++ b/include/ui/GraphicBufferAllocator.h @@ -68,6 +68,11 @@ public: status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage, buffer_handle_t* handle, int32_t* stride); +#ifdef QCOM_BSP + status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage, + buffer_handle_t* handle, int32_t* stride, uint32_t bufferSize); +#endif + status_t free(buffer_handle_t handle); void dump(String8& res) const; |