| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 bool IsBeginMainFrameSent() const; | 148 bool IsBeginMainFrameSent() const; |
| 149 void SetContinuousPainting(bool continuous_painting) { | 149 void SetContinuousPainting(bool continuous_painting) { |
| 150 state_machine_.SetContinuousPainting(continuous_painting); | 150 state_machine_.SetContinuousPainting(continuous_painting); |
| 151 } | 151 } |
| 152 | 152 |
| 153 protected: | 153 protected: |
| 154 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient { | 154 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient { |
| 155 public: | 155 public: |
| 156 SyntheticBeginFrameSource(Scheduler* scheduler, | 156 SyntheticBeginFrameSource(Scheduler* scheduler, |
| 157 base::SingleThreadTaskRunner* task_runner); | 157 scoped_refptr<DelayBasedTimeSource> time_source); |
| 158 virtual ~SyntheticBeginFrameSource(); | 158 virtual ~SyntheticBeginFrameSource(); |
| 159 | 159 |
| 160 // Updates the phase and frequency of the timer. | 160 // Updates the phase and frequency of the timer. |
| 161 void CommitVSyncParameters(base::TimeTicks timebase, | 161 void CommitVSyncParameters(base::TimeTicks timebase, |
| 162 base::TimeDelta interval); | 162 base::TimeDelta interval); |
| 163 | 163 |
| 164 // Activates future BeginFrames and, if activating, pushes the most | 164 // Activates future BeginFrames and, if activating, pushes the most |
| 165 // recently missed BeginFrame to the back of a retroactive queue. | 165 // recently missed BeginFrame to the back of a retroactive queue. |
| 166 void SetNeedsBeginFrame(bool needs_begin_frame, | 166 void SetNeedsBeginFrame(bool needs_begin_frame, |
| 167 std::deque<BeginFrameArgs>* begin_retro_frame_args); | 167 std::deque<BeginFrameArgs>* begin_retro_frame_args); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 178 | 178 |
| 179 Scheduler* scheduler_; | 179 Scheduler* scheduler_; |
| 180 scoped_refptr<DelayBasedTimeSource> time_source_; | 180 scoped_refptr<DelayBasedTimeSource> time_source_; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 Scheduler(SchedulerClient* client, | 183 Scheduler(SchedulerClient* client, |
| 184 const SchedulerSettings& scheduler_settings, | 184 const SchedulerSettings& scheduler_settings, |
| 185 int layer_tree_host_id, | 185 int layer_tree_host_id, |
| 186 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 186 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| 187 | 187 |
| 188 virtual base::TimeTicks Now() const; |
| 189 |
| 188 const SchedulerSettings settings_; | 190 const SchedulerSettings settings_; |
| 189 SchedulerClient* client_; | 191 SchedulerClient* client_; |
| 190 int layer_tree_host_id_; | 192 int layer_tree_host_id_; |
| 191 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 193 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 192 | 194 |
| 193 base::TimeDelta vsync_interval_; | 195 base::TimeDelta vsync_interval_; |
| 194 base::TimeDelta estimated_parent_draw_time_; | 196 base::TimeDelta estimated_parent_draw_time_; |
| 195 | 197 |
| 196 bool last_set_needs_begin_frame_; | 198 bool last_set_needs_begin_frame_; |
| 197 bool begin_unthrottled_frame_posted_; | 199 bool begin_unthrottled_frame_posted_; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 void SetupSyntheticBeginFrames(); | 235 void SetupSyntheticBeginFrames(); |
| 234 | 236 |
| 235 base::WeakPtrFactory<Scheduler> weak_factory_; | 237 base::WeakPtrFactory<Scheduler> weak_factory_; |
| 236 | 238 |
| 237 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 239 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 238 }; | 240 }; |
| 239 | 241 |
| 240 } // namespace cc | 242 } // namespace cc |
| 241 | 243 |
| 242 #endif // CC_SCHEDULER_SCHEDULER_H_ | 244 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |