SF: Track starting layer state with transaction tracing
In order to recreate the layer state from transaction traces,
we need to know the starting layer state. We need to start
with an initial state, then replay the transactions from the
trace to recreate the layer states.
Keeping track of the initial layer state while maintaining
a ring buffer of transactions is expensive since it would
require accessing the drawing state from the tracing
thread.
This cl builds and updates a transaction that will
recreate the layer's starting state. As transactions are
evicted from the ring buffer, they are used to update
the starting state transactions.
Test: presubmit
Bug: 200284593
Change-Id: Ifaba8fb061fca4acc15df661483217552011aa09
diff --git a/services/surfaceflinger/Tracing/TransactionProtoParser.h b/services/surfaceflinger/Tracing/TransactionProtoParser.h
index e8a139f..619ee05 100644
--- a/services/surfaceflinger/Tracing/TransactionProtoParser.h
+++ b/services/surfaceflinger/Tracing/TransactionProtoParser.h
@@ -51,7 +51,7 @@
static proto::TransactionState toProto(const TransactionState&, LayerHandleToIdFn getLayerIdFn,
DisplayHandleToIdFn getDisplayIdFn);
static proto::TransactionState toProto(
- std::vector<std::pair<int32_t /* layerId */, TracingLayerState>>);
+ const std::unordered_map<int32_t /* layerId */, TracingLayerState>);
static proto::LayerCreationArgs toProto(const TracingLayerCreationArgs& args);