| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 virtual void ScheduledActionCommit() = 0; | 42 virtual void ScheduledActionCommit() = 0; |
| 43 virtual void ScheduledActionUpdateVisibleTiles() = 0; | 43 virtual void ScheduledActionUpdateVisibleTiles() = 0; |
| 44 virtual void ScheduledActionActivateSyncTree() = 0; | 44 virtual void ScheduledActionActivateSyncTree() = 0; |
| 45 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; | 45 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; |
| 46 virtual void ScheduledActionManageTiles() = 0; | 46 virtual void ScheduledActionManageTiles() = 0; |
| 47 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; | 47 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; |
| 48 virtual base::TimeDelta DrawDurationEstimate() = 0; | 48 virtual base::TimeDelta DrawDurationEstimate() = 0; |
| 49 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; | 49 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; |
| 50 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; | 50 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; |
| 51 virtual void DidBeginImplFrameDeadline() = 0; | 51 virtual void DidBeginImplFrameDeadline() = 0; |
| 52 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0; |
| 52 | 53 |
| 53 protected: | 54 protected: |
| 54 virtual ~SchedulerClient() {} | 55 virtual ~SchedulerClient() {} |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 class Scheduler; | 58 class Scheduler; |
| 58 // This class exists to allow tests to override the frame source construction. | 59 // This class exists to allow tests to override the frame source construction. |
| 59 // A virtual method can't be used as this needs to happen in the constructor | 60 // A virtual method can't be used as this needs to happen in the constructor |
| 60 // (see C++ FAQ / Section 23 - http://goo.gl/fnrwom for why). | 61 // (see C++ FAQ / Section 23 - http://goo.gl/fnrwom for why). |
| 61 // This class exists solely long enough to construct the frame sources. | 62 // This class exists solely long enough to construct the frame sources. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 87 scheduler_settings, | 88 scheduler_settings, |
| 88 layer_tree_host_id, | 89 layer_tree_host_id, |
| 89 task_runner, | 90 task_runner, |
| 90 power_monitor, | 91 power_monitor, |
| 91 external_begin_frame_source.Pass(), | 92 external_begin_frame_source.Pass(), |
| 92 &frame_sources_constructor)); | 93 &frame_sources_constructor)); |
| 93 } | 94 } |
| 94 | 95 |
| 95 ~Scheduler() override; | 96 ~Scheduler() override; |
| 96 | 97 |
| 98 // BeginFrameObserverMixin |
| 99 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; |
| 100 |
| 97 // base::PowerObserver method. | 101 // base::PowerObserver method. |
| 98 void OnPowerStateChange(bool on_battery_power) override; | 102 void OnPowerStateChange(bool on_battery_power) override; |
| 99 | 103 |
| 100 const SchedulerSettings& settings() const { return settings_; } | 104 const SchedulerSettings& settings() const { return settings_; } |
| 101 | 105 |
| 102 void CommitVSyncParameters(base::TimeTicks timebase, | 106 void CommitVSyncParameters(base::TimeTicks timebase, |
| 103 base::TimeDelta interval); | 107 base::TimeDelta interval); |
| 104 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); | 108 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); |
| 105 | 109 |
| 106 void SetCanStart(); | 110 void SetCanStart(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 163 |
| 160 base::TimeTicks LastBeginImplFrameTime(); | 164 base::TimeTicks LastBeginImplFrameTime(); |
| 161 | 165 |
| 162 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 166 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 163 void AsValueInto(base::debug::TracedValue* value) const override; | 167 void AsValueInto(base::debug::TracedValue* value) const override; |
| 164 | 168 |
| 165 void SetContinuousPainting(bool continuous_painting) { | 169 void SetContinuousPainting(bool continuous_painting) { |
| 166 state_machine_.SetContinuousPainting(continuous_painting); | 170 state_machine_.SetContinuousPainting(continuous_painting); |
| 167 } | 171 } |
| 168 | 172 |
| 169 // BeginFrameObserverMixin | 173 void SetChildrenNeedBeginFrames(bool children_need_begin_frames); |
| 170 bool OnBeginFrameMixInDelegate(const BeginFrameArgs& args) override; | |
| 171 | 174 |
| 172 protected: | 175 protected: |
| 173 Scheduler(SchedulerClient* client, | 176 Scheduler(SchedulerClient* client, |
| 174 const SchedulerSettings& scheduler_settings, | 177 const SchedulerSettings& scheduler_settings, |
| 175 int layer_tree_host_id, | 178 int layer_tree_host_id, |
| 176 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 179 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 177 base::PowerMonitor* power_monitor, | 180 base::PowerMonitor* power_monitor, |
| 178 scoped_ptr<BeginFrameSource> external_begin_frame_source, | 181 scoped_ptr<BeginFrameSource> external_begin_frame_source, |
| 179 SchedulerFrameSourcesConstructor* frame_sources_constructor); | 182 SchedulerFrameSourcesConstructor* frame_sources_constructor); |
| 180 | 183 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 255 |
| 253 friend class SchedulerFrameSourcesConstructor; | 256 friend class SchedulerFrameSourcesConstructor; |
| 254 friend class TestSchedulerFrameSourcesConstructor; | 257 friend class TestSchedulerFrameSourcesConstructor; |
| 255 | 258 |
| 256 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 259 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 257 }; | 260 }; |
| 258 | 261 |
| 259 } // namespace cc | 262 } // namespace cc |
| 260 | 263 |
| 261 #endif // CC_SCHEDULER_SCHEDULER_H_ | 264 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |