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

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: ownership-all-the-things 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
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // is pending at a time. 115 // is pending at a time.
116 virtual void DidFinishFrame(BeginFrameObserver* obs, 116 virtual void DidFinishFrame(BeginFrameObserver* obs,
117 size_t remaining_frames) = 0; 117 size_t remaining_frames) = 0;
118 118
119 // Add/Remove an observer from the source. When no observers are added the BFS 119 // Add/Remove an observer from the source. When no observers are added the BFS
120 // should shut down its timers, disable vsync, etc. 120 // should shut down its timers, disable vsync, etc.
121 virtual void AddObserver(BeginFrameObserver* obs) = 0; 121 virtual void AddObserver(BeginFrameObserver* obs) = 0;
122 virtual void RemoveObserver(BeginFrameObserver* obs) = 0; 122 virtual void RemoveObserver(BeginFrameObserver* obs) = 0;
123 }; 123 };
124 124
125 // A BeginFrameSource that does nothing.
126 class StubBeginFrameSource : public BeginFrameSource {
127 public:
128 void DidFinishFrame(BeginFrameObserver* obs,
129 size_t remaining_frames) override {}
130 void AddObserver(BeginFrameObserver* obs) override {}
131 void RemoveObserver(BeginFrameObserver* obs) override {}
132 };
133
125 // Simple base class which implements a BeginFrameSource. 134 // Simple base class which implements a BeginFrameSource.
126 // Implementation classes should: 135 // Implementation classes should:
127 // - Implement the pure virtual (Set)NeedsBeginFrames methods from 136 // - Implement the pure virtual (Set)NeedsBeginFrames methods from
128 // BeginFrameSource. 137 // BeginFrameSource.
129 // - Use the CallOnBeginFrame method to call to the observer(s). 138 // - Use the CallOnBeginFrame method to call to the observer(s).
130 class CC_EXPORT BeginFrameSourceBase : public BeginFrameSource { 139 class CC_EXPORT BeginFrameSourceBase : public BeginFrameSource {
131 public: 140 public:
132 ~BeginFrameSourceBase() override; 141 ~BeginFrameSourceBase() override;
133 142
134 // BeginFrameSource 143 // BeginFrameSource
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 base::TimeTicks last_timebase_; 228 base::TimeTicks last_timebase_;
220 base::TimeDelta authoritative_interval_; 229 base::TimeDelta authoritative_interval_;
221 230
222 private: 231 private:
223 DISALLOW_COPY_AND_ASSIGN(SyntheticBeginFrameSource); 232 DISALLOW_COPY_AND_ASSIGN(SyntheticBeginFrameSource);
224 }; 233 };
225 234
226 } // namespace cc 235 } // namespace cc
227 236
228 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ 237 #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') | cc/surfaces/display.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698