[sf] write layer snapshots to layer trace

Switch from using drawingstate to layer snapshots
to generate layer trace if new front end is enabled.

Test: atest FlickerTests
Bug: 238781169

Change-Id: I9d75ee51ba77763db6fdd4c29f55e3fc498b683c
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 9b7a405..54f5fa7 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -607,6 +607,7 @@
     bool isRemovedFromCurrentState() const;
 
     LayerProto* writeToProto(LayersProto& layersProto, uint32_t traceFlags);
+    void writeCompositionStateToProto(LayerProto* layerProto);
 
     // Write states that are modified by the main thread. This includes drawing
     // state as well as buffer data. This should be called in the main or tracing