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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; | 168 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
169 void AsValueInto(base::trace_event::TracedValue* value) const override; | 169 void AsValueInto(base::trace_event::TracedValue* value) const override; |
170 | 170 |
171 void SetContinuousPainting(bool continuous_painting) { | 171 void SetContinuousPainting(bool continuous_painting) { |
172 state_machine_.SetContinuousPainting(continuous_painting); | 172 state_machine_.SetContinuousPainting(continuous_painting); |
173 } | 173 } |
174 | 174 |
175 void SetChildrenNeedBeginFrames(bool children_need_begin_frames); | 175 void SetChildrenNeedBeginFrames(bool children_need_begin_frames); |
176 | 176 |
| 177 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); |
| 178 |
177 protected: | 179 protected: |
178 Scheduler(SchedulerClient* client, | 180 Scheduler(SchedulerClient* client, |
179 const SchedulerSettings& scheduler_settings, | 181 const SchedulerSettings& scheduler_settings, |
180 int layer_tree_host_id, | 182 int layer_tree_host_id, |
181 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 183 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
182 base::PowerMonitor* power_monitor, | 184 base::PowerMonitor* power_monitor, |
183 scoped_ptr<BeginFrameSource> external_begin_frame_source, | 185 scoped_ptr<BeginFrameSource> external_begin_frame_source, |
184 SchedulerFrameSourcesConstructor* frame_sources_constructor); | 186 SchedulerFrameSourcesConstructor* frame_sources_constructor); |
185 | 187 |
186 // virtual for testing - Don't call these in the constructor or | 188 // virtual for testing - Don't call these in the constructor or |
187 // destructor! | 189 // destructor! |
188 virtual base::TimeTicks Now() const; | 190 virtual base::TimeTicks Now() const; |
189 | 191 |
190 scoped_ptr<BeginFrameSourceMultiplexer> frame_source_; | 192 scoped_ptr<BeginFrameSourceMultiplexer> frame_source_; |
191 BeginFrameSource* primary_frame_source_; | 193 BeginFrameSource* primary_frame_source_; |
192 BeginFrameSource* background_frame_source_; | 194 BeginFrameSource* background_frame_source_; |
193 BeginFrameSource* unthrottled_frame_source_; | 195 BeginFrameSource* unthrottled_frame_source_; |
194 | 196 |
195 // Storage when frame sources are internal | 197 // Storage when frame sources are internal |
196 scoped_ptr<BeginFrameSource> primary_frame_source_internal_; | 198 scoped_ptr<BeginFrameSource> primary_frame_source_internal_; |
197 scoped_ptr<SyntheticBeginFrameSource> background_frame_source_internal_; | 199 scoped_ptr<SyntheticBeginFrameSource> background_frame_source_internal_; |
198 scoped_ptr<BeginFrameSource> unthrottled_frame_source_internal_; | 200 scoped_ptr<BeginFrameSource> unthrottled_frame_source_internal_; |
199 | 201 |
200 VSyncParameterObserver* vsync_observer_; | 202 VSyncParameterObserver* vsync_observer_; |
| 203 base::TimeDelta authoritative_vsync_interval_; |
| 204 base::TimeTicks last_vsync_timebase_; |
| 205 |
201 bool throttle_frame_production_; | 206 bool throttle_frame_production_; |
202 | 207 |
203 const SchedulerSettings settings_; | 208 const SchedulerSettings settings_; |
204 SchedulerClient* client_; | 209 SchedulerClient* client_; |
205 int layer_tree_host_id_; | 210 int layer_tree_host_id_; |
206 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 211 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
207 | 212 |
208 base::PowerMonitor* power_monitor_; | 213 base::PowerMonitor* power_monitor_; |
209 | 214 |
210 base::TimeDelta estimated_parent_draw_time_; | 215 base::TimeDelta estimated_parent_draw_time_; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 264 |
260 friend class SchedulerFrameSourcesConstructor; | 265 friend class SchedulerFrameSourcesConstructor; |
261 friend class TestSchedulerFrameSourcesConstructor; | 266 friend class TestSchedulerFrameSourcesConstructor; |
262 | 267 |
263 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 268 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
264 }; | 269 }; |
265 | 270 |
266 } // namespace cc | 271 } // namespace cc |
267 | 272 |
268 #endif // CC_SCHEDULER_SCHEDULER_H_ | 273 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |