| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 base::PowerMonitor* power_monitor) { | 84 base::PowerMonitor* power_monitor) { |
| 85 SchedulerFrameSourcesConstructor frame_sources_constructor; | 85 SchedulerFrameSourcesConstructor frame_sources_constructor; |
| 86 return make_scoped_ptr(new Scheduler(client, | 86 return make_scoped_ptr(new Scheduler(client, |
| 87 scheduler_settings, | 87 scheduler_settings, |
| 88 layer_tree_host_id, | 88 layer_tree_host_id, |
| 89 task_runner, | 89 task_runner, |
| 90 power_monitor, | 90 power_monitor, |
| 91 &frame_sources_constructor)); | 91 &frame_sources_constructor)); |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual ~Scheduler(); | 94 ~Scheduler() override; |
| 95 | 95 |
| 96 // base::PowerObserver method. | 96 // base::PowerObserver method. |
| 97 virtual void OnPowerStateChange(bool on_battery_power) override; | 97 void OnPowerStateChange(bool on_battery_power) override; |
| 98 | 98 |
| 99 const SchedulerSettings& settings() const { return settings_; } | 99 const SchedulerSettings& settings() const { return settings_; } |
| 100 | 100 |
| 101 void CommitVSyncParameters(base::TimeTicks timebase, | 101 void CommitVSyncParameters(base::TimeTicks timebase, |
| 102 base::TimeDelta interval); | 102 base::TimeDelta interval); |
| 103 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); | 103 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); |
| 104 | 104 |
| 105 void SetCanStart(); | 105 void SetCanStart(); |
| 106 | 106 |
| 107 void SetVisible(bool visible); | 107 void SetVisible(bool visible); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 bool WillDrawIfNeeded() const; | 152 bool WillDrawIfNeeded() const; |
| 153 | 153 |
| 154 base::TimeTicks AnticipatedDrawTime() const; | 154 base::TimeTicks AnticipatedDrawTime() const; |
| 155 | 155 |
| 156 void NotifyBeginMainFrameStarted(); | 156 void NotifyBeginMainFrameStarted(); |
| 157 | 157 |
| 158 base::TimeTicks LastBeginImplFrameTime(); | 158 base::TimeTicks LastBeginImplFrameTime(); |
| 159 | 159 |
| 160 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 160 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 161 virtual void AsValueInto(base::debug::TracedValue* value) const override; | 161 void AsValueInto(base::debug::TracedValue* value) const override; |
| 162 | 162 |
| 163 void SetContinuousPainting(bool continuous_painting) { | 163 void SetContinuousPainting(bool continuous_painting) { |
| 164 state_machine_.SetContinuousPainting(continuous_painting); | 164 state_machine_.SetContinuousPainting(continuous_painting); |
| 165 } | 165 } |
| 166 | 166 |
| 167 // BeginFrameObserverMixin | 167 // BeginFrameObserverMixin |
| 168 virtual bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; | 168 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; |
| 169 | 169 |
| 170 protected: | 170 protected: |
| 171 Scheduler(SchedulerClient* client, | 171 Scheduler(SchedulerClient* client, |
| 172 const SchedulerSettings& scheduler_settings, | 172 const SchedulerSettings& scheduler_settings, |
| 173 int layer_tree_host_id, | 173 int layer_tree_host_id, |
| 174 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 174 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 175 base::PowerMonitor* power_monitor, | 175 base::PowerMonitor* power_monitor, |
| 176 SchedulerFrameSourcesConstructor* frame_sources_constructor); | 176 SchedulerFrameSourcesConstructor* frame_sources_constructor); |
| 177 | 177 |
| 178 // virtual for testing - Don't call these in the constructor or | 178 // virtual for testing - Don't call these in the constructor or |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 friend class SchedulerFrameSourcesConstructor; | 250 friend class SchedulerFrameSourcesConstructor; |
| 251 friend class TestSchedulerFrameSourcesConstructor; | 251 friend class TestSchedulerFrameSourcesConstructor; |
| 252 | 252 |
| 253 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 253 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 } // namespace cc | 256 } // namespace cc |
| 257 | 257 |
| 258 #endif // CC_SCHEDULER_SCHEDULER_H_ | 258 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |