diff options
Diffstat (limited to 'libshims/include/ui/GraphicBuffer.h')
-rw-r--r-- | libshims/include/ui/GraphicBuffer.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libshims/include/ui/GraphicBuffer.h b/libshims/include/ui/GraphicBuffer.h index bc820b0..fbf0af0 100644 --- a/libshims/include/ui/GraphicBuffer.h +++ b/libshims/include/ui/GraphicBuffer.h @@ -35,6 +35,7 @@ #include <nativebase/nativebase.h> #include <hardware/gralloc.h> +struct ANativeWindowBuffer; namespace android { @@ -140,6 +141,18 @@ public: GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inLayerCount, uint32_t inUsage, uint32_t inStride, native_handle_t* inHandle, bool keepOwnership); + + GraphicBuffer(const native_handle_t* inHandle, HandleWrapMethod method, uint32_t inWidth, + uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage, uint32_t inStride); + + GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage, + uint32_t inStride, native_handle_t* inHandle, bool keepOwnership); + + GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage); + + // create a buffer from an existing ANativeWindowBuffer + GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); + GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage, std::string requestorName = "<Unknown>"); @@ -255,6 +268,10 @@ private: GraphicBufferMapper& mBufferMapper; ssize_t mInitCheck; + // If we're wrapping another buffer then this reference will make sure it + // doesn't get freed. + sp<ANativeWindowBuffer> mWrappedBuffer; + // numbers of fds/ints in native_handle_t to flatten uint32_t mTransportNumFds; uint32_t mTransportNumInts; @@ -285,6 +302,7 @@ private: // and informs SurfaceFlinger that it should drop its strong pointer reference to the buffer. std::vector<std::pair<GraphicBufferDeathCallback, void* /*mDeathCallbackContext*/>> mDeathCallbacks; + }; }; // namespace android |