[sf] update latch time only for layers that will not be latched
Latching happens after the transactions are committed, so fix an
issue where we passed in the incorrect latch time for buffer layers
that was used to classify jank.
Note: this will probably cause a perf regression but this is fixing
an incorrect jank classification caused by
Ie211aa3bd5821f6052cf84a62a2e245132a19d90
Bug: 270041584
Test: presubmit
Change-Id: I632a8ee6a1ed804a17a001e87c06e617ae361b25
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 7d40774..326e1f6 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -347,6 +347,7 @@
void useSurfaceDamage();
void useEmptyDamage();
Region getVisibleRegion(const DisplayDevice*) const;
+ void updateLastLatchTime(nsecs_t latchtime);
/*
* isOpaque - true if this surface is opaque
@@ -623,7 +624,7 @@
* doTransaction - process the transaction. This is a good place to figure
* out which attributes of the surface have changed.
*/
- virtual uint32_t doTransaction(uint32_t transactionFlags, nsecs_t currentLatchTime);
+ virtual uint32_t doTransaction(uint32_t transactionFlags);
/*
* Remove relative z for the layer if its relative parent is not part of the
@@ -860,7 +861,7 @@
void preparePerFrameCompositionState();
void preparePerFrameBufferCompositionState();
void preparePerFrameEffectsCompositionState();
- virtual void commitTransaction(State& stateToCommit, nsecs_t currentLatchTime = 0);
+ virtual void commitTransaction(State& stateToCommit);
void gatherBufferInfo();
void onSurfaceFrameCreated(const std::shared_ptr<frametimeline::SurfaceFrame>&);