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

Side by Side Diff: cc/scheduler/begin_frame_source.h

Issue 2029323004: Get rid of virtual Display::CreateScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onscreendisplayclient
Patch Set: displaytest: unusedvar Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « base/test/test_message_loop.h ('k') | cc/surfaces/display.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 5 #ifndef CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_
6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // is pending at a time. 107 // is pending at a time.
108 virtual void DidFinishFrame(BeginFrameObserver* obs, 108 virtual void DidFinishFrame(BeginFrameObserver* obs,
109 size_t remaining_frames) = 0; 109 size_t remaining_frames) = 0;
110 110
111 // Add/Remove an observer from the source. When no observers are added the BFS 111 // Add/Remove an observer from the source. When no observers are added the BFS
112 // should shut down its timers, disable vsync, etc. 112 // should shut down its timers, disable vsync, etc.
113 virtual void AddObserver(BeginFrameObserver* obs) = 0; 113 virtual void AddObserver(BeginFrameObserver* obs) = 0;
114 virtual void RemoveObserver(BeginFrameObserver* obs) = 0; 114 virtual void RemoveObserver(BeginFrameObserver* obs) = 0;
115 }; 115 };
116 116
117 // A BeginFrameSource that does nothing.
118 class StubBeginFrameSource : public BeginFrameSource {
119 public:
120 void DidFinishFrame(BeginFrameObserver* obs,
121 size_t remaining_frames) override {}
122 void AddObserver(BeginFrameObserver* obs) override {}
123 void RemoveObserver(BeginFrameObserver* obs) override {}
124 };
125
117 // A frame source which ticks itself independently. 126 // A frame source which ticks itself independently.
118 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSource { 127 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSource {
119 public: 128 public:
120 ~SyntheticBeginFrameSource() override; 129 ~SyntheticBeginFrameSource() override;
121 130
122 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, 131 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase,
123 base::TimeDelta interval) = 0; 132 base::TimeDelta interval) = 0;
124 // This overrides any past or future interval from updating vsync parameters. 133 // This overrides any past or future interval from updating vsync parameters.
125 virtual void SetAuthoritativeVSyncInterval(base::TimeDelta interval) = 0; 134 virtual void SetAuthoritativeVSyncInterval(base::TimeDelta interval) = 0;
126 }; 135 };
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 std::unordered_set<BeginFrameObserver*> observers_; 197 std::unordered_set<BeginFrameObserver*> observers_;
189 base::TimeTicks last_timebase_; 198 base::TimeTicks last_timebase_;
190 base::TimeDelta authoritative_interval_; 199 base::TimeDelta authoritative_interval_;
191 200
192 DISALLOW_COPY_AND_ASSIGN(DelayBasedBeginFrameSource); 201 DISALLOW_COPY_AND_ASSIGN(DelayBasedBeginFrameSource);
193 }; 202 };
194 203
195 } // namespace cc 204 } // namespace cc
196 205
197 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 206 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_
OLDNEW
« no previous file with comments | « base/test/test_message_loop.h ('k') | cc/surfaces/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698