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