Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 266a92ca authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Observe frame info from native input code - try 2

Before this CL, the java-based FrameObserver was created in ViewRootImpl
and acted as a proxy between HardwareRenderer and
NativeInputEventReceiver. This caused occasional jank due to garbage
collection, because java objects would be created as part of that
pipeline.

More specifically:
 1. The observers are notified from native code
 2. The observer is implemented in ViewRootImpl. It's a jni call in order to process the observer's notification.
 3. The observer processed the frame stats (input event id, gpu completed time, and present time) and passed it to NativeInputEventReceiver, which is also in native code.
So the path used to be: native -> jni -> java (viewRootImpl) -> jni ->
native.

In this CL, the pipeline is rewired such that the native code is talking
directly to native code, without java. Java is only used in order to
register the observer.

Now, InputEventReceiver creates a FrameMetricsObserver directly in the
native code. This observer is then registered through java with
HardwareRenderer. The notifications about frame stats are now processed
directly in native input code on the render thread.

This reverts commit e1deef99.

Reason for revert: This only broke robolectric tests, which should not
cause a revert per our policy.

Bug: 418774803
Bug: 376713684
Test: N/A
Flag: EXEMPT refactor
Change-Id: Id490d6b437b340a2e1db66d064b5e7a9dd25c814
parent e1deef99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment