diff options
author | 2019-01-22 09:17:19 -0800 | |
---|---|---|
committer | 2019-01-22 14:08:45 -0800 | |
commit | 0c9fc361b466e3ac66d362b23d71ab7ba9b9ca96 (patch) | |
tree | 584d59e706af764f5eb3e1d8d993f6c556a3a909 /libs/ui/Gralloc3.cpp | |
parent | 502fe80d7af0fe4d5abfb600db6c41f7a854bef6 (diff) |
Modifying Gralloc to handle bytesPerPixel and bytesPerStride
Bug: 120493579
Test: build, boot
Change-Id: I1fe5acc17389db6d57529d2e120ab6e1f3715705
Diffstat (limited to 'libs/ui/Gralloc3.cpp')
-rw-r--r-- | libs/ui/Gralloc3.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/ui/Gralloc3.cpp b/libs/ui/Gralloc3.cpp index 128200e33e..acb6b01188 100644 --- a/libs/ui/Gralloc3.cpp +++ b/libs/ui/Gralloc3.cpp @@ -192,7 +192,8 @@ void Gralloc3Mapper::getTransportSize(buffer_handle_t bufferHandle, uint32_t* ou } status_t Gralloc3Mapper::lock(buffer_handle_t bufferHandle, uint64_t usage, const Rect& bounds, - int acquireFence, void** outData) const { + int acquireFence, void** outData, int32_t* outBytesPerPixel, + int32_t* outBytesPerStride) const { auto buffer = const_cast<native_handle_t*>(bufferHandle); IMapper::Rect accessRegion = sGralloc3Rect(bounds); @@ -208,12 +209,19 @@ status_t Gralloc3Mapper::lock(buffer_handle_t bufferHandle, uint64_t usage, cons Error error; auto ret = mMapper->lock(buffer, usage, accessRegion, acquireFenceHandle, - [&](const auto& tmpError, const auto& tmpData) { + [&](const auto& tmpError, const auto& tmpData, + const auto& tmpBytesPerPixel, const auto& tmpBytesPerStride) { error = tmpError; if (error != Error::NONE) { return; } *outData = tmpData; + if (outBytesPerPixel) { + *outBytesPerPixel = tmpBytesPerPixel; + } + if (outBytesPerStride) { + *outBytesPerStride = tmpBytesPerStride; + } }); // we own acquireFence even on errors |