| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 private: | 160 private: |
| 161 DISALLOW_COPY_AND_ASSIGN(TestSyntheticBeginFrameSource); | 161 DISALLOW_COPY_AND_ASSIGN(TestSyntheticBeginFrameSource); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 class FakeCompositorTimingHistory : public CompositorTimingHistory { | 164 class FakeCompositorTimingHistory : public CompositorTimingHistory { |
| 165 public: | 165 public: |
| 166 static scoped_ptr<FakeCompositorTimingHistory> Create(); | 166 static scoped_ptr<FakeCompositorTimingHistory> Create(); |
| 167 ~FakeCompositorTimingHistory() override; | 167 ~FakeCompositorTimingHistory() override; |
| 168 | 168 |
| 169 void SetAllEstimatesTo(base::TimeDelta duration); |
| 170 |
| 169 void SetBeginMainFrameToCommitDurationEstimate(base::TimeDelta duration); | 171 void SetBeginMainFrameToCommitDurationEstimate(base::TimeDelta duration); |
| 170 void SetCommitToReadyToActivateDurationEstimate(base::TimeDelta duration); | 172 void SetCommitToReadyToActivateDurationEstimate(base::TimeDelta duration); |
| 171 void SetPrepareTilesDurationEstimate(base::TimeDelta duration); | 173 void SetPrepareTilesDurationEstimate(base::TimeDelta duration); |
| 172 void SetActivateDurationEstimate(base::TimeDelta duration); | 174 void SetActivateDurationEstimate(base::TimeDelta duration); |
| 173 void SetDrawDurationEstimate(base::TimeDelta duration); | 175 void SetDrawDurationEstimate(base::TimeDelta duration); |
| 174 | 176 |
| 175 base::TimeDelta BeginMainFrameToCommitDurationEstimate() const override; | 177 base::TimeDelta BeginMainFrameToCommitDurationEstimate() const override; |
| 176 base::TimeDelta CommitToReadyToActivateDurationEstimate() const override; | 178 base::TimeDelta CommitToReadyToActivateDurationEstimate() const override; |
| 177 base::TimeDelta PrepareTilesDurationEstimate() const override; | 179 base::TimeDelta PrepareTilesDurationEstimate() const override; |
| 178 base::TimeDelta ActivateDurationEstimate() const override; | 180 base::TimeDelta ActivateDurationEstimate() const override; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 204 int layer_tree_host_id, | 206 int layer_tree_host_id, |
| 205 OrderedSimpleTaskRunner* task_runner, | 207 OrderedSimpleTaskRunner* task_runner, |
| 206 BeginFrameSource* external_frame_source, | 208 BeginFrameSource* external_frame_source, |
| 207 scoped_ptr<CompositorTimingHistory> compositor_timing_history); | 209 scoped_ptr<CompositorTimingHistory> compositor_timing_history); |
| 208 | 210 |
| 209 // Extra test helper functionality | 211 // Extra test helper functionality |
| 210 bool IsBeginRetroFrameArgsEmpty() const { | 212 bool IsBeginRetroFrameArgsEmpty() const { |
| 211 return begin_retro_frame_args_.empty(); | 213 return begin_retro_frame_args_.empty(); |
| 212 } | 214 } |
| 213 | 215 |
| 216 bool SwapThrottled() const { return state_machine_.SwapThrottled(); } |
| 217 |
| 214 bool CanStart() const { return state_machine_.CanStartForTesting(); } | 218 bool CanStart() const { return state_machine_.CanStartForTesting(); } |
| 215 | 219 |
| 220 bool NeedsCommit() const { return state_machine_.needs_commit(); } |
| 221 |
| 216 BeginFrameSource& frame_source() { return *frame_source_; } | 222 BeginFrameSource& frame_source() { return *frame_source_; } |
| 217 bool FrameProductionThrottled() { return throttle_frame_production_; } | 223 bool FrameProductionThrottled() { return throttle_frame_production_; } |
| 218 | 224 |
| 225 bool MainThreadIsInHighLatencyMode() const { |
| 226 return state_machine_.MainThreadIsInHighLatencyMode(); |
| 227 } |
| 228 |
| 219 ~TestScheduler() override; | 229 ~TestScheduler() override; |
| 220 | 230 |
| 221 base::TimeDelta BeginImplFrameInterval() { | 231 base::TimeDelta BeginImplFrameInterval() { |
| 222 return begin_impl_frame_tracker_.Interval(); | 232 return begin_impl_frame_tracker_.Interval(); |
| 223 } | 233 } |
| 224 | 234 |
| 225 protected: | 235 protected: |
| 226 // Overridden from Scheduler. | 236 // Overridden from Scheduler. |
| 227 base::TimeTicks Now() const override; | 237 base::TimeTicks Now() const override; |
| 228 | 238 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 239 scoped_ptr<CompositorTimingHistory> compositor_timing_history); | 249 scoped_ptr<CompositorTimingHistory> compositor_timing_history); |
| 240 | 250 |
| 241 base::SimpleTestTickClock* now_src_; | 251 base::SimpleTestTickClock* now_src_; |
| 242 | 252 |
| 243 DISALLOW_COPY_AND_ASSIGN(TestScheduler); | 253 DISALLOW_COPY_AND_ASSIGN(TestScheduler); |
| 244 }; | 254 }; |
| 245 | 255 |
| 246 } // namespace cc | 256 } // namespace cc |
| 247 | 257 |
| 248 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ | 258 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ |
| OLD | NEW |