| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "cc/debug/rendering_stats_instrumentation.h" | 13 #include "cc/debug/rendering_stats_instrumentation.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 void FakeDelayBasedTimeSourceClient::OnTimerTick() { | 17 void FakeDelayBasedTimeSourceClient::OnTimerTick() { |
| 18 tick_called_ = true; | 18 tick_called_ = true; |
| 19 } | 19 } |
| 20 | 20 |
| 21 base::TimeTicks FakeDelayBasedTimeSource::Now() const { return now_; } | |
| 22 | |
| 23 TestDelayBasedTimeSource::TestDelayBasedTimeSource( | |
| 24 base::SimpleTestTickClock* now_src, | |
| 25 OrderedSimpleTaskRunner* task_runner) | |
| 26 : DelayBasedTimeSource(task_runner), now_src_(now_src) {} | |
| 27 | |
| 28 base::TimeTicks TestDelayBasedTimeSource::Now() const { | |
| 29 return now_src_->NowTicks(); | |
| 30 } | |
| 31 | |
| 32 std::string TestDelayBasedTimeSource::TypeString() const { | |
| 33 return "TestDelayBasedTimeSource"; | |
| 34 } | |
| 35 | |
| 36 TestDelayBasedTimeSource::~TestDelayBasedTimeSource() { | |
| 37 } | |
| 38 | |
| 39 std::unique_ptr<FakeCompositorTimingHistory> | 21 std::unique_ptr<FakeCompositorTimingHistory> |
| 40 FakeCompositorTimingHistory::Create( | 22 FakeCompositorTimingHistory::Create( |
| 41 bool using_synchronous_renderer_compositor) { | 23 bool using_synchronous_renderer_compositor) { |
| 42 std::unique_ptr<RenderingStatsInstrumentation> | 24 std::unique_ptr<RenderingStatsInstrumentation> |
| 43 rendering_stats_instrumentation = RenderingStatsInstrumentation::Create(); | 25 rendering_stats_instrumentation = RenderingStatsInstrumentation::Create(); |
| 44 return base::WrapUnique(new FakeCompositorTimingHistory( | 26 return base::WrapUnique(new FakeCompositorTimingHistory( |
| 45 using_synchronous_renderer_compositor, | 27 using_synchronous_renderer_compositor, |
| 46 std::move(rendering_stats_instrumentation))); | 28 std::move(rendering_stats_instrumentation))); |
| 47 } | 29 } |
| 48 | 30 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 now_src_(now_src) {} | 140 now_src_(now_src) {} |
| 159 | 141 |
| 160 base::TimeTicks TestScheduler::Now() const { | 142 base::TimeTicks TestScheduler::Now() const { |
| 161 return now_src_->NowTicks(); | 143 return now_src_->NowTicks(); |
| 162 } | 144 } |
| 163 | 145 |
| 164 TestScheduler::~TestScheduler() { | 146 TestScheduler::~TestScheduler() { |
| 165 } | 147 } |
| 166 | 148 |
| 167 } // namespace cc | 149 } // namespace cc |
| OLD | NEW |