This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ void VsyncWaiter::ScheduleSecondaryCallback(uintptr_t id,
8686 return ;
8787 }
8888 }
89- AwaitVSync ();
89+ AwaitVSyncForSecondaryCallback ();
9090}
9191
9292void VsyncWaiter::FireCallback (fml::TimePoint frame_start_time,
Original file line number Diff line number Diff line change @@ -42,12 +42,29 @@ class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
4242
4343 VsyncWaiter (TaskRunners task_runners);
4444
45+ // There are two distinct situations where VsyncWaiter wishes to awaken at
46+ // the next vsync. Although the functionality can be the same, the intent is
47+ // different, therefore it makes sense to have a method for each intent.
48+
49+ // The intent of AwaitVSync() is that the Animator wishes to produce a frame.
50+ // The underlying implementation can choose to be aware of this intent when
51+ // it comes to implementing backpressure and other scheduling invariants.
52+ //
4553 // Implementations are meant to override this method and arm their vsync
4654 // latches when in response to this invocation. On vsync, they are meant to
4755 // invoke the |FireCallback| method once (and only once) with the appropriate
4856 // arguments. This method should not block the current thread.
4957 virtual void AwaitVSync () = 0;
5058
59+ // The intent of AwaitVSyncForSecondaryCallback() is simply to wake up at the
60+ // next vsync.
61+ //
62+ // Because there is no association with frame scheduling, underlying
63+ // implementations do not need to worry about maintaining invariants or
64+ // backpressure. The default implementation is to simply follow the same logic
65+ // as AwaitVSync().
66+ virtual void AwaitVSyncForSecondaryCallback () { AwaitVSync (); }
67+
5168 void FireCallback (fml::TimePoint frame_start_time,
5269 fml::TimePoint frame_target_time);
5370
You can’t perform that action at this time.
0 commit comments