Chromium Code Reviews| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 BeginFrameArgs begin_impl_frame_args() { return begin_impl_frame_args_; } |
| 188 | 188 |
| 189 bool MainThreadIsInHighLatencyMode() const { | |
| 190 return state_machine_.MainThreadIsInHighLatencyMode(); | |
| 191 } | |
| 192 | |
| 193 bool ImplThreadIsLikelyInHighLatencyMode() const { | |
| 194 return state_machine_.swaps_are_likely_high_latency(); | |
| 195 } | |
| 196 | |
| 197 bool BeginImplFrameDeadlinePendingForTest() const { | |
|
brianderson
2015/05/08 16:52:50
I guess this change wasn't strictly necessary in t
| |
| 198 return BeginImplFrameDeadlinePending(); | |
| 199 } | |
| 200 | |
| 189 ~TestScheduler() override; | 201 ~TestScheduler() override; |
| 190 | 202 |
| 191 void NotifyReadyToCommitThenActivateIfNeeded() { | 203 void NotifyReadyToCommitThenActivateIfNeeded() { |
| 192 NotifyReadyToCommit(); | 204 NotifyReadyToCommit(); |
| 193 if (settings_.impl_side_painting) { | 205 if (settings_.impl_side_painting) { |
| 194 NotifyReadyToActivate(); | 206 NotifyReadyToActivate(); |
| 195 } | 207 } |
| 196 } | 208 } |
| 197 | 209 |
| 198 protected: | 210 protected: |
| 199 // Overridden from Scheduler. | 211 // Overridden from Scheduler. |
| 200 base::TimeTicks Now() const override; | 212 base::TimeTicks Now() const override; |
| 201 | 213 |
| 202 private: | 214 private: |
| 203 TestScheduler( | 215 TestScheduler( |
| 204 scoped_refptr<TestNowSource> now_src, | 216 scoped_refptr<TestNowSource> now_src, |
| 205 SchedulerClient* client, | 217 SchedulerClient* client, |
| 206 const SchedulerSettings& scheduler_settings, | 218 const SchedulerSettings& scheduler_settings, |
| 207 int layer_tree_host_id, | 219 int layer_tree_host_id, |
| 208 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, | 220 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, |
| 209 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, | 221 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, |
| 210 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 222 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
| 211 | 223 |
| 212 scoped_refptr<TestNowSource> now_src_; | 224 scoped_refptr<TestNowSource> now_src_; |
| 213 }; | 225 }; |
| 214 | 226 |
| 215 } // namespace cc | 227 } // namespace cc |
| 216 | 228 |
| 217 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ | 229 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ |
| OLD | NEW |