Add rate limiting to fps reporter.
From a user perspective, the jittery frame rate is jarring, and from a
performance perspective submitting a binder call every frame is
overkill. To address those two concerns add rate-limiting from
SurfaceFlinger to limit the frame rate reporting.
As part of this patch, extract OneShotTimer's fake clock interface to a
SF-common location so that FpsReporter can share that interface for
testing.
Bug: 186265654
Test: Manually inspect fps overlay
Test: libsurfaceflinger_unittest
Change-Id: I45eb994d847abbb9fc8d5ff7d07ad51a1a790176
8 files changed