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