[sf] use snapshots to update layer history
Avoid directly accessing layer drawing state from layer
history, instead provide a snapshot of the layer data
needed.
Test: atest android.graphics.cts.MatchContentFrameRateTest android.graphics.cts.SetFrameRateTest
Bug: 238781169
Change-Id: I120e89cca70beb9811a8ee9c5c3203f2a5cfabb4
diff --git a/services/surfaceflinger/Scheduler/LayerHistory.h b/services/surfaceflinger/Scheduler/LayerHistory.h
index 68e7030..69caf9f 100644
--- a/services/surfaceflinger/Scheduler/LayerHistory.h
+++ b/services/surfaceflinger/Scheduler/LayerHistory.h
@@ -38,6 +38,7 @@
namespace scheduler {
class LayerInfo;
+struct LayerProps;
class LayerHistory {
public:
@@ -63,7 +64,8 @@
};
// Marks the layer as active, and records the given state to its history.
- void record(Layer*, nsecs_t presentTime, nsecs_t now, LayerUpdateType updateType);
+ void record(int32_t id, const LayerProps& props, nsecs_t presentTime, nsecs_t now,
+ LayerUpdateType updateType);
// Updates the default frame rate compatibility which takes effect when the app
// does not set a preference for refresh rate.