Skip to content

Commit

Permalink
try to further fix RecordVsync multi called flutter#5835
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Sep 26, 2022
1 parent 983fc92 commit 8aa5488
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shell/common/vsync_waiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
// << task_runners_.GetRasterTaskRunner()->RunsTasksOnCurrentThread();
FML_DCHECK(fml::TimePoint::Now() >= frame_start_time);

LastVsyncInfo::Instance().RecordVsync(frame_start_time, frame_target_time);

Callback callback;
std::vector<fml::closure> secondary_callbacks;

Expand All @@ -184,6 +182,10 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
return;
}

// NOTE must be after "callback empty then return", b/c a flutter bug
// #5835
LastVsyncInfo::Instance().RecordVsync(frame_start_time, frame_target_time);

// hack: schedule immediately to ensure [LastVsyncInfo] is updated every 16ms
// in real implementation, will instead have real start/pause mechanism
// instead of such blindly refresh
Expand Down

0 comments on commit 8aa5488

Please sign in to comment.