Consolidate PostWorker::compose() interface
... by converting `ComposeDevice` and `ComposeDevice_v2` into a
single `FlatComposeRequest` and having `PostWorker` use this single
flattened type. Also, make some const correctness changes that
touch the compose request.
Bug: b/229145718
Test: `launch_cvd --gpu_mode=gfxstream`
Change-Id: I0eb9ae7a4ff9a91e9f47a1460def86967034779b
diff --git a/stream-servers/Hwc2.h b/stream-servers/Hwc2.h
index 1817b9c..90c7f4b 100644
--- a/stream-servers/Hwc2.h
+++ b/stream-servers/Hwc2.h
@@ -16,7 +16,9 @@
#ifndef _LIBRENDER_HWC2_H
#define _LIBRENDER_HWC2_H
+#include <memory>
#include <stdint.h>
+#include <vector>
/* Copied from Android source */
@@ -110,4 +112,12 @@
struct compose_layer layer[0];
} ComposeDevice_v2;
+typedef struct FlatComposeRequest {
+ uint32_t displayId;
+ uint32_t targetHandle;
+ std::vector<ComposeLayer> layers;
+} FlatComposeRequest;
+std::unique_ptr<FlatComposeRequest> ToFlatComposeRequest(const ComposeDevice* in);
+std::unique_ptr<FlatComposeRequest> ToFlatComposeRequest(const ComposeDevice_v2* in);
+
#endif