@@ -42,12 +42,29 @@ class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
4242
4343 explicit 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 bool pause_secondary_tasks = true );
0 commit comments