summaryrefslogtreecommitdiff
path: root/libs/ui/Gralloc4.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2024-02-21 16:12:02 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-02-21 16:12:02 +0000
commitf9b7ec9f279e36432c4582549574b99601d57dfe (patch)
treed3648c05aee3a8ff03e59b55f7a21080cfc49f20 /libs/ui/Gralloc4.cpp
parent37cceb7d4e91d742b681d7c66a3da5e03a97bf73 (diff)
parent434bc98a0fec826dfdffc19658ba12b9a9da606c (diff)
Merge "Move PlaneLayout lookup to GraphicBuffer" into main
Diffstat (limited to 'libs/ui/Gralloc4.cpp')
-rw-r--r--libs/ui/Gralloc4.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/libs/ui/Gralloc4.cpp b/libs/ui/Gralloc4.cpp
index d6970e0477..2a607308d1 100644
--- a/libs/ui/Gralloc4.cpp
+++ b/libs/ui/Gralloc4.cpp
@@ -262,37 +262,8 @@ void Gralloc4Mapper::getTransportSize(buffer_handle_t bufferHandle, uint32_t* ou
status_t Gralloc4Mapper::lock(buffer_handle_t bufferHandle, uint64_t usage, const Rect& bounds,
int acquireFence, void** outData, int32_t* outBytesPerPixel,
int32_t* outBytesPerStride) const {
- std::vector<ui::PlaneLayout> planeLayouts;
- status_t err = getPlaneLayouts(bufferHandle, &planeLayouts);
-
- if (err == NO_ERROR && !planeLayouts.empty()) {
- if (outBytesPerPixel) {
- int32_t bitsPerPixel = planeLayouts.front().sampleIncrementInBits;
- for (const auto& planeLayout : planeLayouts) {
- if (bitsPerPixel != planeLayout.sampleIncrementInBits) {
- bitsPerPixel = -1;
- }
- }
- if (bitsPerPixel >= 0 && bitsPerPixel % 8 == 0) {
- *outBytesPerPixel = bitsPerPixel / 8;
- } else {
- *outBytesPerPixel = -1;
- }
- }
- if (outBytesPerStride) {
- int32_t bytesPerStride = planeLayouts.front().strideInBytes;
- for (const auto& planeLayout : planeLayouts) {
- if (bytesPerStride != planeLayout.strideInBytes) {
- bytesPerStride = -1;
- }
- }
- if (bytesPerStride >= 0) {
- *outBytesPerStride = bytesPerStride;
- } else {
- *outBytesPerStride = -1;
- }
- }
- }
+ if (outBytesPerPixel) *outBytesPerPixel = -1;
+ if (outBytesPerStride) *outBytesPerStride = -1;
auto buffer = const_cast<native_handle_t*>(bufferHandle);