@@ -42,12 +42,29 @@ class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
42
42
43
43
VsyncWaiter (TaskRunners task_runners);
44
44
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
+ //
45
53
// Implementations are meant to override this method and arm their vsync
46
54
// latches when in response to this invocation. On vsync, they are meant to
47
55
// invoke the |FireCallback| method once (and only once) with the appropriate
48
56
// arguments. This method should not block the current thread.
49
57
virtual void AwaitVSync () = 0;
50
58
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
+
51
68
void FireCallback (fml::TimePoint frame_start_time,
52
69
fml::TimePoint frame_target_time,
53
70
bool pause_secondary_tasks = true );
0 commit comments