diff options
author | koron393 <koron393@gmail.com> | 2019-09-16 01:32:35 +0900 |
---|---|---|
committer | Arian <arian.kulmer@web.de> | 2020-02-07 20:09:45 +0100 |
commit | de5416ca15c27aa1b204e540a5510f54b67cb3f6 (patch) | |
tree | 3300830b4fd0ee739afb124603bf8bb633f7f5e5 /libshims/include/ui/GraphicBuffer.h | |
parent | 4d957a736845635f75cc8281d850c49d82b41275 (diff) |
shinano-common: libshim_camera: Add pre N method to GraphicBuffer
* Add Marshmallow method to GraphicBuffer and Mapper.
* Apply module loading changes to Allocator.
Signed-off-by: koron393 <koron393@gmail.com>
Change-Id: I906fa4f123afd9b9e1b62f6e53c1a2f753a027c3
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 |