4 Commits

Author SHA1 Message Date
Pirama Arumuga Nainar
459afe96d1 Mark FrameMetricsObserver::notify() as pure virtual
Bug: http://b/116873221

If not, Clang assumes that the TU which defines this function will
contain the vtable for the class as well.  Since there's no out-of-line
definition of this funciton, no TU ends up with the vtable.

This causes a problem with coverage builds, which are built with -O0,
where calls don't get inlined, thereby requiring a definition of the
vtable.  For non -O0 builds, the vtable is not required since the
virtual calls get inlined/optimized-out.

Test: Build with and without -O0.
Change-Id: I60a5cefcd1c327f1e00785fedbb2163c682b33d1
2019-02-07 13:24:24 -08:00
John Reck
1bcacfdcab Format the world (or just HWUI)
Test: No code changes, just ran through clang-format
Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-11-03 10:57:44 -07:00
Andres Morales
11f02d7e52 allow for slow FrameMetricsListeners
A slow listener could cause a race in the NotifyHandler
where the single reference to the buffer to send would get
updated when it shouldn't have been.

Switch to a queue of available buffers to prevent this race.

Also, stop setting and clearing the observer reference and instead
incStrong/decStrong to mark temporary strong ownership without
colliding with other owners in flight.

Bug: 27097094
Change-Id: Iee647bfae8b80019b6d8290179eed3973230901f
2016-02-17 12:16:06 -08:00
Andres Morales
910beb8f5d updates to FrameStatsObserver API
- Rename to FrameMetrics to avoid collision with existing
  android.view.FrameStats class
- Make FrameMetricsObserver implementation detail,
  exposing FrameMetricsListener interface as public API
  and wrapping in FrameStatsObserver to maintain state
- Remove dropped frame count call, in favor of passing as
  parameter to callback method.
- Move away from raw timestamp access in favor of Metric IDs
  which represent higher-level, more stable stages in a frame
  lifecycle and match the categories exposed in the onscreen
  bars.
- Support many-to-many Window<->FrameMetricsListener relationship

Change-Id: I00e741d664d4c868b1b6d0131a23f8316bd8c5c2
2016-02-09 10:40:01 -08:00