diff options
| author | 2017-04-06 12:34:32 -0700 | |
|---|---|---|
| committer | 2017-04-10 11:38:27 -0700 | |
| commit | 5bac7f36ee9d5ed0c2e8a0141909ca94351965a8 (patch) | |
| tree | 8792daf50dc14038ab25df1d5d792c52ebb64813 /libs/ui/GraphicBuffer.cpp | |
| parent | 1a50a60ad01dfcd27bc31ba03370da4d0fe8c723 (diff) | |
libui: update for revised HIDL gralloc
The revised HIDL gralloc is implementable on top of gralloc0 and
gralloc1, which enables us to remove all legacy code.
However, it lacks the ability to query buffer properties from a
buffer handle. GetBufferFromHandle in VR always fails.
Bug: 36481301
Test: builds and boots on Pixel
Change-Id: Id7cfa2d2172dfc008803860f24fcf4f03ba05f11
Diffstat (limited to 'libs/ui/GraphicBuffer.cpp')
| -rw-r--r-- | libs/ui/GraphicBuffer.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index d21758d41e..eb5c7b6ca1 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -22,7 +22,7 @@ #include <grallocusage/GrallocUsageConversion.h> -#include <ui/GrallocMapper.h> +#include <ui/Gralloc2.h> #include <ui/GraphicBufferAllocator.h> #include <ui/GraphicBufferMapper.h> @@ -104,11 +104,7 @@ GraphicBuffer::~GraphicBuffer() void GraphicBuffer::free_handle() { if (mOwner == ownHandle) { - mBufferMapper.unregisterBuffer(handle); - if (!mBufferMapper.getGrallocMapper().valid()) { - native_handle_close(handle); - native_handle_delete(const_cast<native_handle*>(handle)); - } + mBufferMapper.freeBuffer(handle); } else if (mOwner == ownData) { GraphicBufferAllocator& allocator(GraphicBufferAllocator::get()); allocator.free(handle); @@ -217,7 +213,7 @@ status_t GraphicBuffer::initWithHandle(const native_handle_t* handle, mOwner = (method == WRAP_HANDLE) ? ownNone : ownHandle; if (method == TAKE_UNREGISTERED_HANDLE) { - status_t err = mBufferMapper.registerBuffer(this); + status_t err = mBufferMapper.importBuffer(this); if (err != NO_ERROR) { // clean up cloned handle if (clone) { @@ -451,7 +447,7 @@ status_t GraphicBuffer::unflatten( mOwner = ownHandle; if (handle != 0) { - status_t err = mBufferMapper.registerBuffer(this); + status_t err = mBufferMapper.importBuffer(this); if (err != NO_ERROR) { width = height = stride = format = layerCount = usage = 0; handle = NULL; |