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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 protected: | 50 protected: |
51 virtual ~SchedulerClient() {} | 51 virtual ~SchedulerClient() {} |
52 }; | 52 }; |
53 | 53 |
54 class CC_EXPORT Scheduler { | 54 class CC_EXPORT Scheduler { |
55 public: | 55 public: |
56 static scoped_ptr<Scheduler> Create( | 56 static scoped_ptr<Scheduler> Create( |
57 SchedulerClient* client, | 57 SchedulerClient* client, |
58 const SchedulerSettings& scheduler_settings, | 58 const SchedulerSettings& scheduler_settings, |
59 int layer_tree_host_id, | 59 int layer_tree_host_id, |
60 const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner) { | 60 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { |
61 return make_scoped_ptr(new Scheduler( | 61 return make_scoped_ptr(new Scheduler( |
62 client, scheduler_settings, layer_tree_host_id, impl_task_runner)); | 62 client, scheduler_settings, layer_tree_host_id, task_runner)); |
63 } | 63 } |
64 | 64 |
65 virtual ~Scheduler(); | 65 virtual ~Scheduler(); |
66 | 66 |
67 const SchedulerSettings& settings() const { return settings_; } | 67 const SchedulerSettings& settings() const { return settings_; } |
68 | 68 |
69 void CommitVSyncParameters(base::TimeTicks timebase, | 69 void CommitVSyncParameters(base::TimeTicks timebase, |
70 base::TimeDelta interval); | 70 base::TimeDelta interval); |
71 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); | 71 void SetEstimatedParentDrawTime(base::TimeDelta draw_time); |
72 | 72 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 void AsValueInto(base::debug::TracedValue* dict) const; | 167 void AsValueInto(base::debug::TracedValue* dict) const; |
168 | 168 |
169 private: | 169 private: |
170 BeginFrameArgs CreateSyntheticBeginFrameArgs(base::TimeTicks frame_time); | 170 BeginFrameArgs CreateSyntheticBeginFrameArgs(base::TimeTicks frame_time); |
171 | 171 |
172 Scheduler* scheduler_; | 172 Scheduler* scheduler_; |
173 scoped_refptr<DelayBasedTimeSource> time_source_; | 173 scoped_refptr<DelayBasedTimeSource> time_source_; |
174 }; | 174 }; |
175 | 175 |
176 Scheduler( | 176 Scheduler(SchedulerClient* client, |
177 SchedulerClient* client, | 177 const SchedulerSettings& scheduler_settings, |
178 const SchedulerSettings& scheduler_settings, | 178 int layer_tree_host_id, |
179 int layer_tree_host_id, | 179 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
180 const scoped_refptr<base::SingleThreadTaskRunner>& impl_task_runner); | |
181 | 180 |
182 const SchedulerSettings settings_; | 181 const SchedulerSettings settings_; |
183 SchedulerClient* client_; | 182 SchedulerClient* client_; |
184 int layer_tree_host_id_; | 183 int layer_tree_host_id_; |
185 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner_; | 184 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
186 | 185 |
187 base::TimeDelta vsync_interval_; | 186 base::TimeDelta vsync_interval_; |
188 base::TimeDelta estimated_parent_draw_time_; | 187 base::TimeDelta estimated_parent_draw_time_; |
189 | 188 |
190 bool last_set_needs_begin_frame_; | 189 bool last_set_needs_begin_frame_; |
191 bool begin_unthrottled_frame_posted_; | 190 bool begin_unthrottled_frame_posted_; |
192 bool begin_retro_frame_posted_; | 191 bool begin_retro_frame_posted_; |
193 std::deque<BeginFrameArgs> begin_retro_frame_args_; | 192 std::deque<BeginFrameArgs> begin_retro_frame_args_; |
194 BeginFrameArgs begin_impl_frame_args_; | 193 BeginFrameArgs begin_impl_frame_args_; |
195 | 194 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void SetupSyntheticBeginFrames(); | 226 void SetupSyntheticBeginFrames(); |
228 | 227 |
229 base::WeakPtrFactory<Scheduler> weak_factory_; | 228 base::WeakPtrFactory<Scheduler> weak_factory_; |
230 | 229 |
231 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 230 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
232 }; | 231 }; |
233 | 232 |
234 } // namespace cc | 233 } // namespace cc |
235 | 234 |
236 #endif // CC_SCHEDULER_SCHEDULER_H_ | 235 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |