Skip to content

Use AChoreographer_registerRefreshRateCallback to get actual refresh rate #93688

@dnfield

Description

@dnfield

Today, the Android embedding calls Display#getRefreshRate once at initialization to get the refresh rate, and then assumes that stays stable when talking to the VSync waiter.

This is actually incorrect, since modern devices can dynamically change refresh rates. However, repeatedly calling getRefreshRate can be slow on some phones (2.5-5ms measured on a Huawei Nova 3), and calling it every frame is expensive.

We should use the AChoreographer_registerRefreshRateCallback where it's available to more efficiently get the FPS rate. This will unblock using the vsync target time for flutter/engine#29727

@blasten @ds84182 FYI

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallywaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions