Skip to content

Commit

Permalink
try to schedule all vsync flutter#6197
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Oct 15, 2022
1 parent 5ddbfae commit 031bffd
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions shell/common/vsync_waiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
// #5835
LastVsyncInfo::Instance().RecordVsync(frame_start_time, frame_target_time);

// temporarily disable this
// https://github.com/fzyzcjy/flutter_smooth/issues/38#issuecomment-1262271851
/*
// 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 All @@ -222,12 +219,18 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
// "ensure every frame we see info";
// NOTE must be *after* checking empty and early return
// for that, see #5835
ScheduleSecondaryCallback(
reinterpret_cast<uintptr_t>(&LastVsyncInfo::Instance()), [] {},
// NOTE do NOT sanity check thread, since closure is empty and we only
// want to trigger scheduling
false);
*/
task_runners_.GetPlatformTaskRunner()->PostDelayedTask(
[this] {
ScheduleSecondaryCallback(
reinterpret_cast<uintptr_t>(&LastVsyncInfo::Instance()), [] {},
// NOTE do NOT sanity check thread, since closure is empty and we
// only want to trigger scheduling
false);
},
// NOTE add delay - without this delay, have seen FireCallback multi
// times for roughly one vsync within a few milliseconds
// #6197
fml::TimeDelta::FromMilliseconds(3));

// for debug #5988
// use the name "VSYNC" since #6049
Expand Down

0 comments on commit 031bffd

Please sign in to comment.