diff options
author | koron393 <koron393@gmail.com> | 2019-05-07 03:01:14 +0900 |
---|---|---|
committer | Arian <arian.kulmer@web.de> | 2019-10-25 22:16:13 +0200 |
commit | 5a6ff3a367c8736fef6af23608866248c2fec43e (patch) | |
tree | 6e072264562929dadeea7f4e178a6cbdd8e7a43f /libshims/include/ui | |
parent | eb4c130ccf05799fe7c20a4737f21dd63c0dbed5 (diff) |
msm8974-common: libshim_camera: Apply revert patches to Marshmallow
* Fix build.
* Revert GraphicBuffer method to Marshmallow (for 23.5.A.1.291 blobs).
* Apply module loading changes.
* TODO: Remove unneeded sources.
Change-Id: Ifce6a23840bd8c6170e0b8a714233d7b5e99acb4
Diffstat (limited to 'libshims/include/ui')
-rw-r--r-- | libshims/include/ui/GraphicBuffer.h | 14 | ||||
-rw-r--r-- | libshims/include/ui/GraphicBufferAllocator.h | 4 |
2 files changed, 15 insertions, 3 deletions
diff --git a/libshims/include/ui/GraphicBuffer.h b/libshims/include/ui/GraphicBuffer.h index cc38982..7b4fac8 100644 --- a/libshims/include/ui/GraphicBuffer.h +++ b/libshims/include/ui/GraphicBuffer.h @@ -31,6 +31,7 @@ #include <nativebase/nativebase.h> #include <hardware/gralloc.h> +struct ANativeWindowBuffer; namespace android { @@ -126,14 +127,19 @@ public: // These functions are deprecated because they only take 32 bits of usage GraphicBuffer(const native_handle_t* handle, HandleWrapMethod method, uint32_t width, uint32_t height, - PixelFormat format, uint32_t layerCount, + PixelFormat format, uint32_t usage, uint32_t stride) : GraphicBuffer(handle, method, width, height, format, layerCount, static_cast<uint64_t>(usage), stride) {} GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, - uint32_t inLayerCount, uint32_t inUsage, uint32_t inStride, + 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>"); // return status @@ -236,6 +242,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; diff --git a/libshims/include/ui/GraphicBufferAllocator.h b/libshims/include/ui/GraphicBufferAllocator.h index 14a865e..546fb4b 100644 --- a/libshims/include/ui/GraphicBufferAllocator.h +++ b/libshims/include/ui/GraphicBufferAllocator.h @@ -32,6 +32,8 @@ #include <utils/Mutex.h> #include <utils/Singleton.h> +#include <hardware/gralloc.h> + namespace android { namespace Gralloc2 { @@ -75,7 +77,7 @@ private: GraphicBufferAllocator(); ~GraphicBufferAllocator(); - GraphicBufferMapper& mMapper; + alloc_device_t *mAllocDev; const std::unique_ptr<const Gralloc2::Allocator> mAllocator; }; |