CE: Snapshot layer metadata

Adds LayerMetadata to LayerSnapshots. LayerMetadata is only populated
when CE enables the new feature flag and the feature flag will only be
enabled in ARC++'s CE.

This change is necessary to split LayerFE from the Layer class as
ARC++'s LayerFE subclass accesses LayerMetadata.

Bug: 238781169
Test: go/wm-smoke
Test: presubmit

Change-Id: Iae405707897eedf5af9025fe628c1cd60b596e10
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 3c92d56..0c60137 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -699,6 +699,7 @@
     bool latchBuffers();
 
     void updateLayerGeometry();
+    void updateLayerMetadataSnapshot();
 
     void updateInputFlinger();
     void persistDisplayBrightness(bool needsComposite) REQUIRES(kMainThreadContext);
@@ -1176,6 +1177,9 @@
     bool mSomeDataspaceChanged = false;
     bool mForceTransactionDisplayChange = false;
 
+    // Set if LayerMetadata has changed since the last LayerMetadata snapshot.
+    bool mLayerMetadataSnapshotNeeded = false;
+
     // Tracks layers that have pending frames which are candidates for being
     // latched.
     std::unordered_set<sp<Layer>, SpHash<Layer>> mLayersWithQueuedFrames;