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