Loading libs/ui/Gralloc1On0Adapter.cpp +17 −6 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ #include <ui/Gralloc1On0Adapter.h> #include <algorithm> #include <array> #include <grallocusage/GrallocUsageConversion.h> #include <hardware/gralloc.h> Loading Loading @@ -67,13 +70,18 @@ Gralloc1On0Adapter::~Gralloc1On0Adapter() void Gralloc1On0Adapter::doGetCapabilities(uint32_t* outCount, int32_t* outCapabilities) { constexpr std::array<int32_t, 2> supportedCapabilities = {{ GRALLOC1_CAPABILITY_ON_ADAPTER, GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE, }}; if (outCapabilities == nullptr) { *outCount = 1; return; } if (*outCount >= 1) { *outCapabilities = GRALLOC1_CAPABILITY_ON_ADAPTER; *outCount = 1; *outCount = supportedCapabilities.size(); } else { *outCount = std::min(*outCount, static_cast<uint32_t>( supportedCapabilities.size())); std::copy_n(supportedCapabilities.begin(), *outCount, outCapabilities); } } Loading Loading @@ -325,6 +333,9 @@ gralloc1_error_t Gralloc1On0Adapter::release( if (result != 0) { ALOGE("gralloc0 unregister failed: %d", result); } native_handle_close(handle); native_handle_delete(const_cast<native_handle_t*>(handle)); } mBuffers.erase(handle); Loading libs/ui/GraphicBufferMapper.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -122,9 +122,11 @@ status_t GraphicBufferMapper::freeBuffer(buffer_handle_t handle) error = GRALLOC1_ERROR_NONE; } else { error = mDevice->release(handle); if (!mDevice->hasCapability(GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE)) { native_handle_close(handle); native_handle_delete(const_cast<native_handle_t*>(handle)); } } ALOGW_IF(error != GRALLOC1_ERROR_NONE, "freeBuffer(%p): failed %d", handle, error); Loading Loading
libs/ui/Gralloc1On0Adapter.cpp +17 −6 Original line number Diff line number Diff line Loading @@ -20,6 +20,9 @@ #include <ui/Gralloc1On0Adapter.h> #include <algorithm> #include <array> #include <grallocusage/GrallocUsageConversion.h> #include <hardware/gralloc.h> Loading Loading @@ -67,13 +70,18 @@ Gralloc1On0Adapter::~Gralloc1On0Adapter() void Gralloc1On0Adapter::doGetCapabilities(uint32_t* outCount, int32_t* outCapabilities) { constexpr std::array<int32_t, 2> supportedCapabilities = {{ GRALLOC1_CAPABILITY_ON_ADAPTER, GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE, }}; if (outCapabilities == nullptr) { *outCount = 1; return; } if (*outCount >= 1) { *outCapabilities = GRALLOC1_CAPABILITY_ON_ADAPTER; *outCount = 1; *outCount = supportedCapabilities.size(); } else { *outCount = std::min(*outCount, static_cast<uint32_t>( supportedCapabilities.size())); std::copy_n(supportedCapabilities.begin(), *outCount, outCapabilities); } } Loading Loading @@ -325,6 +333,9 @@ gralloc1_error_t Gralloc1On0Adapter::release( if (result != 0) { ALOGE("gralloc0 unregister failed: %d", result); } native_handle_close(handle); native_handle_delete(const_cast<native_handle_t*>(handle)); } mBuffers.erase(handle); Loading
libs/ui/GraphicBufferMapper.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -122,9 +122,11 @@ status_t GraphicBufferMapper::freeBuffer(buffer_handle_t handle) error = GRALLOC1_ERROR_NONE; } else { error = mDevice->release(handle); if (!mDevice->hasCapability(GRALLOC1_CAPABILITY_RELEASE_IMPLY_DELETE)) { native_handle_close(handle); native_handle_delete(const_cast<native_handle_t*>(handle)); } } ALOGW_IF(error != GRALLOC1_ERROR_NONE, "freeBuffer(%p): failed %d", handle, error); Loading