10 Commits

Author SHA1 Message Date
Greg Kaiser
346312c1f5 Make sure fields are initialized before access
We initialize mSurfaceControlId and mAttachedFrameNumber in the
constructor to assure they'll always give consistent values
when read.

Test: TreeHugger
Bug: 195699687
Change-Id: I471b402e4654a0c02082109d8828ad6b59085f13
2021-09-10 13:56:32 +00:00
Pablo Gamito
35b80cde92 Make frame number type consistent
The frame numbers are ultimately stored as uint64_t so to avoid any implementation dependent casting we make sure all direct and indirect references to this value are stored as uint64_t

Test: N/A
Change-Id: I080c94b1007f2e884cf0fa3583bf51badc913a05
2021-09-07 16:47:25 +00:00
Pablo Gamito
88660d77da Stop reporting frame stats from frames completed before observer was attached
Test: Run app from bug report
Fixes: 195699687
Change-Id: If80825dfb41467917b7b9b1e8c9ead1a0dcbffae
2021-08-31 10:33:28 +00:00
Siarhei Vishniakou
f0cf18d3ed Pass actual present time to ViewRootImpl
To measure end-to-end touch latency, we need to report the actual
present time to ViewRootImpl. ViewRootImpl, in turn, will report this
information to InputDispatcher. Finally, InputDispatcher will combine
all known information for a specific input event, and will report this
data to westworld.

In another patch, we will add a new call, 'reportLatencyInfo', to
InputPublisher. This call will allow the app to send this latency data
to InputDispatcher.

Bug: 169866723
Test: printed the input event present times inside ViewRootImpl
Change-Id: Ibd3a2cfeb1a340eb15cd2165071df1f8589634af
2021-03-05 21:42:32 +00:00
Pirama Arumuga Nainar
7a6e219539 Merge "Mark FrameMetricsObserver::notify() as pure virtual" am: 0b3cef8697 am: fec4795045
am: dbeb139e26

Change-Id: I4194a12a2f7b3fadc5e442590946d1de2dd63f17
2019-02-12 18:48:55 -08:00
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
Chris Blume
7b8a808b7d Remove ; from closing namespaces in libs/hwui
When closing a namespace a } is sufficient. It doesn't need to be };
like closing a class or enum.

Within frameworks/base/libs/hwui there is a mix between } and }; when
closing a namespace. There are even mixes between a .h and the
corresponding .cpp files.

In a separate CL I was asked to not close with };. That was a good
comment. I adopted the style from nearby code. This CL cleans up the
nearby code.

Test: I made sure the code still built as expected.
Change-Id: Ieb314a4f48d6e33752463f3be4361fdc9be97482
2018-12-03 16:05:14 -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