| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "cc/test/scheduler_test_common.h" | 5 #include "cc/test/scheduler_test_common.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "cc/debug/rendering_stats_instrumentation.h" | 10 #include "cc/debug/rendering_stats_instrumentation.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 void FakeTimeSourceClient::OnTimerTick() { | 14 void FakeDelayBasedTimeSourceClient::OnMissedTick() { |
| 15 tick_called_ = true; | 15 tick_called_ = true; |
| 16 } | 16 } |
| 17 | 17 |
| 18 void FakeDelayBasedTimeSourceClient::OnTimerTick() { |
| 19 tick_called_ = true; |
| 20 } |
| 21 |
| 18 base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; } | 22 base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; } |
| 19 | 23 |
| 20 TestDelayBasedTimeSource::TestDelayBasedTimeSource( | 24 TestDelayBasedTimeSource::TestDelayBasedTimeSource( |
| 21 base::SimpleTestTickClock* now_src, | 25 base::SimpleTestTickClock* now_src, |
| 22 base::TimeDelta interval, | 26 base::TimeDelta interval, |
| 23 OrderedSimpleTaskRunner* task_runner) | 27 OrderedSimpleTaskRunner* task_runner) |
| 24 : DelayBasedTimeSource(interval, task_runner), now_src_(now_src) { | 28 : DelayBasedTimeSource(interval, task_runner), now_src_(now_src) { |
| 25 } | 29 } |
| 26 | 30 |
| 27 base::TimeTicks TestDelayBasedTimeSource::Now() const { | 31 base::TimeTicks TestDelayBasedTimeSource::Now() const { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 52 } | 56 } |
| 53 | 57 |
| 54 TestBackToBackBeginFrameSource::~TestBackToBackBeginFrameSource() { | 58 TestBackToBackBeginFrameSource::~TestBackToBackBeginFrameSource() { |
| 55 } | 59 } |
| 56 | 60 |
| 57 base::TimeTicks TestBackToBackBeginFrameSource::Now() { | 61 base::TimeTicks TestBackToBackBeginFrameSource::Now() { |
| 58 return now_src_->NowTicks(); | 62 return now_src_->NowTicks(); |
| 59 } | 63 } |
| 60 | 64 |
| 61 TestSyntheticBeginFrameSource::TestSyntheticBeginFrameSource( | 65 TestSyntheticBeginFrameSource::TestSyntheticBeginFrameSource( |
| 66 OrderedSimpleTaskRunner* task_runner, |
| 62 scoped_ptr<DelayBasedTimeSource> time_source) | 67 scoped_ptr<DelayBasedTimeSource> time_source) |
| 63 : SyntheticBeginFrameSource(time_source.Pass()) { | 68 : SyntheticBeginFrameSource(task_runner, time_source.Pass()) { |
| 64 } | 69 } |
| 65 | 70 |
| 66 TestSyntheticBeginFrameSource::~TestSyntheticBeginFrameSource() { | 71 TestSyntheticBeginFrameSource::~TestSyntheticBeginFrameSource() { |
| 67 } | 72 } |
| 68 | 73 |
| 69 scoped_ptr<FakeCompositorTimingHistory> FakeCompositorTimingHistory::Create() { | 74 scoped_ptr<FakeCompositorTimingHistory> FakeCompositorTimingHistory::Create() { |
| 70 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation = | 75 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation = |
| 71 RenderingStatsInstrumentation::Create(); | 76 RenderingStatsInstrumentation::Create(); |
| 72 return make_scoped_ptr( | 77 return make_scoped_ptr( |
| 73 new FakeCompositorTimingHistory(rendering_stats_instrumentation.Pass())); | 78 new FakeCompositorTimingHistory(rendering_stats_instrumentation.Pass())); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 160 } |
| 156 | 161 |
| 157 base::TimeTicks TestScheduler::Now() const { | 162 base::TimeTicks TestScheduler::Now() const { |
| 158 return now_src_->NowTicks(); | 163 return now_src_->NowTicks(); |
| 159 } | 164 } |
| 160 | 165 |
| 161 TestScheduler::~TestScheduler() { | 166 TestScheduler::~TestScheduler() { |
| 162 } | 167 } |
| 163 | 168 |
| 164 } // namespace cc | 169 } // namespace cc |
| OLD | NEW |