SF: use FenceTime when possible
Fence::getSignalTime is calling a system call everytime,
where FenceTime caches the signal time.
This shows reduction in simpleperf for the main thread
2.23% -> 1.25%
Test: simpleperf for PIP + Notification shade expansion
Bug: 184378996
Change-Id: I182db2ddfcb7fdbde758f5d87357a16e60c1bb07
diff --git a/services/surfaceflinger/FrameTracker.h b/services/surfaceflinger/FrameTracker.h
index 35382be..bc412ae 100644
--- a/services/surfaceflinger/FrameTracker.h
+++ b/services/surfaceflinger/FrameTracker.h
@@ -66,7 +66,7 @@
// setActualPresentFence sets the fence that is used to get the time
// at which the current frame became visible to the user.
- void setActualPresentFence(std::shared_ptr<FenceTime>&& fence);
+ void setActualPresentFence(const std::shared_ptr<FenceTime>& fence);
// setDisplayRefreshPeriod sets the display refresh period in nanoseconds.
// This is used to compute frame presentation duration statistics relative