summaryrefslogtreecommitdiff
path: root/cros_gralloc/gralloc4/CrosGralloc4Allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'cros_gralloc/gralloc4/CrosGralloc4Allocator.h')
-rw-r--r--cros_gralloc/gralloc4/CrosGralloc4Allocator.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/cros_gralloc/gralloc4/CrosGralloc4Allocator.h b/cros_gralloc/gralloc4/CrosGralloc4Allocator.h
index 21ad7ad..9c1c783 100644
--- a/cros_gralloc/gralloc4/CrosGralloc4Allocator.h
+++ b/cros_gralloc/gralloc4/CrosGralloc4Allocator.h
@@ -8,19 +8,27 @@
#include <android/hardware/graphics/mapper/4.0/IMapper.h>
#include "cros_gralloc/cros_gralloc_driver.h"
+#include "cros_gralloc/cros_gralloc_helpers.h"
+#include "cros_gralloc/gralloc4/CrosGralloc4Metadata.h"
class CrosGralloc4Allocator : public android::hardware::graphics::allocator::V4_0::IAllocator {
public:
- CrosGralloc4Allocator();
+ CrosGralloc4Allocator() = default;
android::hardware::Return<void> allocate(const android::hardware::hidl_vec<uint8_t>& descriptor,
uint32_t count, allocate_cb hidl_cb) override;
+ android::hardware::graphics::mapper::V4_0::Error init();
+
private:
+ android::hardware::graphics::mapper::V4_0::Error initializeMetadata(
+ cros_gralloc_handle_t crosHandle,
+ const struct cros_gralloc_buffer_descriptor& crosDescriptor);
+
android::hardware::graphics::mapper::V4_0::Error allocate(
const android::hardware::graphics::mapper::V4_0::IMapper::BufferDescriptorInfo&
description,
uint32_t* outStride, android::hardware::hidl_handle* outHandle);
- std::unique_ptr<cros_gralloc_driver> mDriver;
+ cros_gralloc_driver* mDriver = nullptr;
};