Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Unified Diff: cc/scheduler/begin_frame_source.h

Issue 2591013004: [cc] Add and use BeginFrameAck for DidFinishFrame. (Closed)
Patch Set: remove ipc struct traits for BeginFrameAck. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/begin_frame_args.cc ('k') | cc/scheduler/begin_frame_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/begin_frame_source.h
diff --git a/cc/scheduler/begin_frame_source.h b/cc/scheduler/begin_frame_source.h
index c25fff651426ef031f8d22ae2446809f81f2256a..58ee480d01138cc235f49ec13456019bb97b23f1 100644
--- a/cc/scheduler/begin_frame_source.h
+++ b/cc/scheduler/begin_frame_source.h
@@ -104,12 +104,19 @@ class CC_EXPORT BeginFrameSource {
BeginFrameSource();
virtual ~BeginFrameSource() {}
- // DidFinishFrame provides back pressure to a frame source about frame
- // processing (rather than toggling SetNeedsBeginFrames every frame). It is
- // used by systems like the BackToBackFrameSource to make sure only one frame
- // is pending at a time.
+ // BeginFrameObservers use DidFinishFrame to acknowledge that they have
+ // completed handling a BeginFrame.
+ //
+ // The DisplayScheduler uses these acknowledgments to trigger an early
+ // deadline once all BeginFrameObservers have completed a frame.
+ //
+ // They also provide back pressure to a frame source about frame processing
+ // (rather than toggling SetNeedsBeginFrames every frame). For example, the
+ // BackToBackFrameSource uses them to make sure only one frame is pending at a
+ // time.
+ // TODO(eseckler): Use BeginFrameAcks in DisplayScheduler as described above.
virtual void DidFinishFrame(BeginFrameObserver* obs,
- size_t remaining_frames) = 0;
+ const BeginFrameAck& ack) = 0;
// Add/Remove an observer from the source. When no observers are added the BFS
// should shut down its timers, disable vsync, etc.
@@ -134,7 +141,7 @@ class CC_EXPORT BeginFrameSource {
class CC_EXPORT StubBeginFrameSource : public BeginFrameSource {
public:
void DidFinishFrame(BeginFrameObserver* obs,
- size_t remaining_frames) override {}
+ const BeginFrameAck& ack) override {}
void AddObserver(BeginFrameObserver* obs) override {}
void RemoveObserver(BeginFrameObserver* obs) override {}
bool IsThrottled() const override;
@@ -164,7 +171,7 @@ class CC_EXPORT BackToBackBeginFrameSource : public SyntheticBeginFrameSource,
void AddObserver(BeginFrameObserver* obs) override;
void RemoveObserver(BeginFrameObserver* obs) override;
void DidFinishFrame(BeginFrameObserver* obs,
- size_t remaining_frames) override;
+ const BeginFrameAck& ack) override;
bool IsThrottled() const override;
// SyntheticBeginFrameSource implementation.
@@ -198,7 +205,7 @@ class CC_EXPORT DelayBasedBeginFrameSource : public SyntheticBeginFrameSource,
void AddObserver(BeginFrameObserver* obs) override;
void RemoveObserver(BeginFrameObserver* obs) override;
void DidFinishFrame(BeginFrameObserver* obs,
- size_t remaining_frames) override {}
+ const BeginFrameAck& ack) override {}
bool IsThrottled() const override;
// SyntheticBeginFrameSource implementation.
@@ -243,7 +250,7 @@ class CC_EXPORT ExternalBeginFrameSource : public BeginFrameSource {
void AddObserver(BeginFrameObserver* obs) override;
void RemoveObserver(BeginFrameObserver* obs) override;
void DidFinishFrame(BeginFrameObserver* obs,
- size_t remaining_frames) override {}
+ const BeginFrameAck& ack) override {}
bool IsThrottled() const override;
void OnSetBeginFrameSourcePaused(bool paused);
« no previous file with comments | « cc/output/begin_frame_args.cc ('k') | cc/scheduler/begin_frame_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698