flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.58k stars 324 forks source link

DevTools assumes the framerate for a device does not change once the performance page opens #3269

Open jacob314 opened 3 years ago

jacob314 commented 3 years ago

Some devices like a Pixel4 can intentionally switch between 60 and 90fps.

We currently appear to only query for the refresh rate on startup. We probably need to receive the target refresh rate with each frame timing even or receive separate events when the target frame rate changes. https://github.com/flutter/devtools/blob/64aefd56202560727758bac7e5629841c902e5fa/packages/devtools_app/lib/src/performance/performance_controller.dart#L200

Fyi @kenzieschmoll, @jonahwilliams

kenzieschmoll commented 3 years ago

Strong preference for adding an event we can listen for when the displayRefreshRate changes. I think it would be too expensive to call into the engine on every frame. Would sending an event for this need to happen in the engine? @iskakaushik