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

Commit 7524d2f2 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Observe frame info from native input code - try 3

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 c4102c39.

Reason for revert: stop calling 'dispose' when bad metrics are received

Test: atest InputEventSenderAndReceiverTest
Bug: 418774803
Bug: 376713684
Bug: 419468066
Change-Id: I77401257ce6e6bdff1977526f8589661217b0908
parent 7eb97fee
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