[Android] Do not underutilize CPU/GPU when can't keep up with refresh rate by kekekeks · Pull Request #18973 · AvaloniaUI/Avalonia (original) (raw)
Right now we request a new frame when we are done with rendering the current one. If we can't keep up with the screen refresh rate the following happens:
This makes Avalonia to skip every other frame, 2 of 3 frames, 3 of 4 frames, etc depending on how bad the situation is. This leads to an instant 60->30 FPS drop while we are utilizing ~51+% of CPU/GPU resources.
Instead we want to do this:
This PR introduces a separate render thread and relies on Choreographer to throttle our rendering instead of driving it.
