OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_SCHEDULER_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_H_ |
6 #define CC_SCHEDULER_SCHEDULER_H_ | 6 #define CC_SCHEDULER_SCHEDULER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 class Scheduler; | 56 class Scheduler; |
57 // This class exists to allow tests to override the frame source construction. | 57 // This class exists to allow tests to override the frame source construction. |
58 // A virtual method can't be used as this needs to happen in the constructor | 58 // A virtual method can't be used as this needs to happen in the constructor |
59 // (see C++ FAQ / Section 23 - http://goo.gl/fnrwom for why). | 59 // (see C++ FAQ / Section 23 - http://goo.gl/fnrwom for why). |
60 // This class exists solely long enough to construct the frame sources. | 60 // This class exists solely long enough to construct the frame sources. |
61 class CC_EXPORT SchedulerFrameSourcesConstructor { | 61 class CC_EXPORT SchedulerFrameSourcesConstructor { |
62 public: | 62 public: |
63 virtual ~SchedulerFrameSourcesConstructor() {} | 63 virtual ~SchedulerFrameSourcesConstructor() {} |
64 virtual BeginFrameSource* ConstructPrimaryFrameSource(Scheduler* scheduler); | 64 virtual BeginFrameSource* ConstructPrimaryFrameSource(Scheduler* scheduler); |
65 virtual BeginFrameSource* ConstructBackgroundFrameSource( | |
66 Scheduler* scheduler); | |
67 virtual BeginFrameSource* ConstructUnthrottledFrameSource( | 65 virtual BeginFrameSource* ConstructUnthrottledFrameSource( |
68 Scheduler* scheduler); | 66 Scheduler* scheduler); |
69 | 67 |
70 protected: | 68 protected: |
71 SchedulerFrameSourcesConstructor() {} | 69 SchedulerFrameSourcesConstructor() {} |
72 | 70 |
73 friend class Scheduler; | 71 friend class Scheduler; |
74 }; | 72 }; |
75 | 73 |
76 class CC_EXPORT Scheduler : public BeginFrameObserverMixIn { | 74 class CC_EXPORT Scheduler : public BeginFrameObserverMixIn { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 173 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
176 scoped_ptr<BeginFrameSource> external_begin_frame_source, | 174 scoped_ptr<BeginFrameSource> external_begin_frame_source, |
177 SchedulerFrameSourcesConstructor* frame_sources_constructor); | 175 SchedulerFrameSourcesConstructor* frame_sources_constructor); |
178 | 176 |
179 // virtual for testing - Don't call these in the constructor or | 177 // virtual for testing - Don't call these in the constructor or |
180 // destructor! | 178 // destructor! |
181 virtual base::TimeTicks Now() const; | 179 virtual base::TimeTicks Now() const; |
182 | 180 |
183 scoped_ptr<BeginFrameSourceMultiplexer> frame_source_; | 181 scoped_ptr<BeginFrameSourceMultiplexer> frame_source_; |
184 BeginFrameSource* primary_frame_source_; | 182 BeginFrameSource* primary_frame_source_; |
185 BeginFrameSource* background_frame_source_; | |
186 BeginFrameSource* unthrottled_frame_source_; | 183 BeginFrameSource* unthrottled_frame_source_; |
187 | 184 |
188 // Storage when frame sources are internal | 185 // Storage when frame sources are internal |
189 scoped_ptr<BeginFrameSource> primary_frame_source_internal_; | 186 scoped_ptr<BeginFrameSource> primary_frame_source_internal_; |
190 scoped_ptr<SyntheticBeginFrameSource> background_frame_source_internal_; | |
191 scoped_ptr<BeginFrameSource> unthrottled_frame_source_internal_; | 187 scoped_ptr<BeginFrameSource> unthrottled_frame_source_internal_; |
192 | 188 |
193 VSyncParameterObserver* vsync_observer_; | 189 VSyncParameterObserver* vsync_observer_; |
194 base::TimeDelta authoritative_vsync_interval_; | 190 base::TimeDelta authoritative_vsync_interval_; |
195 base::TimeTicks last_vsync_timebase_; | 191 base::TimeTicks last_vsync_timebase_; |
196 | 192 |
197 bool throttle_frame_production_; | 193 bool throttle_frame_production_; |
198 | 194 |
199 const SchedulerSettings settings_; | 195 const SchedulerSettings settings_; |
200 SchedulerClient* client_; | 196 SchedulerClient* client_; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 247 |
252 friend class SchedulerFrameSourcesConstructor; | 248 friend class SchedulerFrameSourcesConstructor; |
253 friend class TestSchedulerFrameSourcesConstructor; | 249 friend class TestSchedulerFrameSourcesConstructor; |
254 | 250 |
255 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 251 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
256 }; | 252 }; |
257 | 253 |
258 } // namespace cc | 254 } // namespace cc |
259 | 255 |
260 #endif // CC_SCHEDULER_SCHEDULER_H_ | 256 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |