Initialize layers with metadata
layers weren't being initialized with metadata, this meant a
traversal was required in order to apply the setmetadata call.
While this seemed to happen in practice, its a weird thing to
rely on.
Bug: 122925737
Test: Behavior is same
Change-Id: I455f6c69ce92e6045aa0c12f8cfbb70c1d283088
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 79d2238..7f802e9 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -80,8 +80,9 @@
struct LayerCreationArgs {
LayerCreationArgs(SurfaceFlinger* flinger, const sp<Client>& client, const String8& name,
- uint32_t w, uint32_t h, uint32_t flags)
- : flinger(flinger), client(client), name(name), w(w), h(h), flags(flags) {}
+ uint32_t w, uint32_t h, uint32_t flags, LayerMetadata metadata)
+ : flinger(flinger), client(client), name(name), w(w), h(h), flags(flags),
+ metadata(std::move(metadata)) {}
SurfaceFlinger* flinger;
const sp<Client>& client;
@@ -89,6 +90,7 @@
uint32_t w;
uint32_t h;
uint32_t flags;
+ LayerMetadata metadata;
};
class Layer : public virtual compositionengine::LayerFE {