diff options
Diffstat (limited to 'include/ui/Gralloc1On0Adapter.h')
-rw-r--r-- | include/ui/Gralloc1On0Adapter.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/ui/Gralloc1On0Adapter.h b/include/ui/Gralloc1On0Adapter.h index d523c4f7e7..2508ce91bb 100644 --- a/include/ui/Gralloc1On0Adapter.h +++ b/include/ui/Gralloc1On0Adapter.h @@ -131,6 +131,7 @@ private: width(0), height(0), format(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED), + layerCount(1), producerUsage(GRALLOC1_PRODUCER_USAGE_NONE), consumerUsage(GRALLOC1_CONSUMER_USAGE_NONE) {} @@ -145,6 +146,11 @@ private: return GRALLOC1_ERROR_NONE; } + gralloc1_error_t setLayerCount(uint32_t lc) { + layerCount = lc; + return GRALLOC1_ERROR_NONE; + } + gralloc1_error_t setProducerUsage(gralloc1_producer_usage_t usage) { producerUsage = usage; return GRALLOC1_ERROR_NONE; @@ -161,6 +167,7 @@ private: uint32_t width; uint32_t height; int32_t format; + uint32_t layerCount; gralloc1_producer_usage_t producerUsage; gralloc1_consumer_usage_t consumerUsage; }; @@ -197,6 +204,12 @@ private: &Descriptor::setFormat, format); } + static int32_t setLayerCountHook(gralloc1_device_t* device, + gralloc1_buffer_descriptor_t descriptorId, uint32_t layerCount) { + return callDescriptorFunction(device, descriptorId, + &Descriptor::setLayerCount, layerCount); + } + static int32_t setProducerUsageHook(gralloc1_device_t* device, gralloc1_buffer_descriptor_t descriptorId, uint64_t intUsage) { auto usage = static_cast<gralloc1_producer_usage_t>(intUsage); @@ -246,6 +259,11 @@ private: return GRALLOC1_ERROR_NONE; } + gralloc1_error_t getLayerCount(uint32_t* outLayerCount) const { + *outLayerCount = mDescriptor.layerCount; + return GRALLOC1_ERROR_NONE; + } + gralloc1_error_t getNumFlexPlanes(uint32_t* outNumPlanes) const { // TODO: This is conservative, and we could do better by examining // the format, but it won't hurt anything for now |