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_TEST_SCHEDULER_TEST_COMMON_H_ | 5 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_ |
6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ | 6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 power_monitor, | 175 power_monitor, |
176 &frame_sources_constructor, | 176 &frame_sources_constructor, |
177 external_begin_frame_source.Pass())); | 177 external_begin_frame_source.Pass())); |
178 } | 178 } |
179 | 179 |
180 // Extra test helper functionality | 180 // Extra test helper functionality |
181 bool IsBeginRetroFrameArgsEmpty() const { | 181 bool IsBeginRetroFrameArgsEmpty() const { |
182 return begin_retro_frame_args_.empty(); | 182 return begin_retro_frame_args_.empty(); |
183 } | 183 } |
184 | 184 |
| 185 bool CanStart() const { return state_machine_.CanStartForTesting(); } |
| 186 |
185 BeginFrameSource& frame_source() { return *frame_source_; } | 187 BeginFrameSource& frame_source() { return *frame_source_; } |
186 | 188 |
187 ~TestScheduler() override; | 189 ~TestScheduler() override; |
188 | 190 |
| 191 void NotifyReadyToCommitThenActivateIfNeeded() { |
| 192 NotifyReadyToCommit(); |
| 193 if (settings_.impl_side_painting) { |
| 194 NotifyReadyToActivate(); |
| 195 } |
| 196 } |
| 197 |
189 protected: | 198 protected: |
190 // Overridden from Scheduler. | 199 // Overridden from Scheduler. |
191 base::TimeTicks Now() const override; | 200 base::TimeTicks Now() const override; |
192 | 201 |
193 private: | 202 private: |
194 TestScheduler( | 203 TestScheduler( |
195 scoped_refptr<TestNowSource> now_src, | 204 scoped_refptr<TestNowSource> now_src, |
196 SchedulerClient* client, | 205 SchedulerClient* client, |
197 const SchedulerSettings& scheduler_settings, | 206 const SchedulerSettings& scheduler_settings, |
198 int layer_tree_host_id, | 207 int layer_tree_host_id, |
199 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, | 208 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, |
200 base::PowerMonitor* power_monitor, | 209 base::PowerMonitor* power_monitor, |
201 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, | 210 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, |
202 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 211 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
203 | 212 |
204 scoped_refptr<TestNowSource> now_src_; | 213 scoped_refptr<TestNowSource> now_src_; |
205 }; | 214 }; |
206 | 215 |
207 } // namespace cc | 216 } // namespace cc |
208 | 217 |
209 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ | 218 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ |
OLD | NEW |