| 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" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 FakeCompositorTimingHistory::FakeCompositorTimingHistory( | 76 FakeCompositorTimingHistory::FakeCompositorTimingHistory( |
| 77 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation) | 77 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation) |
| 78 : CompositorTimingHistory(rendering_stats_instrumentation.get()), | 78 : CompositorTimingHistory(rendering_stats_instrumentation.get()), |
| 79 rendering_stats_instrumentation_owned_( | 79 rendering_stats_instrumentation_owned_( |
| 80 rendering_stats_instrumentation.Pass()) { | 80 rendering_stats_instrumentation.Pass()) { |
| 81 } | 81 } |
| 82 | 82 |
| 83 FakeCompositorTimingHistory::~FakeCompositorTimingHistory() { | 83 FakeCompositorTimingHistory::~FakeCompositorTimingHistory() { |
| 84 } | 84 } |
| 85 | 85 |
| 86 void FakeCompositorTimingHistory::SetBeginMainFrameToCommitDurationEstimate( |
| 87 base::TimeDelta duration) { |
| 88 begin_main_frame_to_commit_duration_ = duration; |
| 89 } |
| 90 |
| 91 void FakeCompositorTimingHistory::SetCommitToReadyToActivateDurationEstimate( |
| 92 base::TimeDelta duration) { |
| 93 commit_to_ready_to_activate_duration_ = duration; |
| 94 } |
| 95 |
| 96 void FakeCompositorTimingHistory::SetPrepareTilesDurationEstimate( |
| 97 base::TimeDelta duration) { |
| 98 prepare_tiles_duration_ = duration; |
| 99 } |
| 100 |
| 101 void FakeCompositorTimingHistory::SetActivateDurationEstimate( |
| 102 base::TimeDelta duration) { |
| 103 activate_duration_ = duration; |
| 104 } |
| 105 |
| 86 void FakeCompositorTimingHistory::SetDrawDurationEstimate( | 106 void FakeCompositorTimingHistory::SetDrawDurationEstimate( |
| 87 base::TimeDelta duration) { | 107 base::TimeDelta duration) { |
| 88 draw_duration_ = duration; | 108 draw_duration_ = duration; |
| 89 } | 109 } |
| 90 | 110 |
| 91 void FakeCompositorTimingHistory::SetBeginMainFrameToCommitDurationEstimate( | |
| 92 base::TimeDelta duration) { | |
| 93 begin_main_frame_to_commit_duration_ = duration; | |
| 94 } | |
| 95 | |
| 96 void FakeCompositorTimingHistory::SetCommitToActivateDurationEstimate( | |
| 97 base::TimeDelta duration) { | |
| 98 commit_to_activate_duration_ = duration; | |
| 99 } | |
| 100 | |
| 101 base::TimeDelta FakeCompositorTimingHistory::DrawDurationEstimate() const { | |
| 102 return draw_duration_; | |
| 103 } | |
| 104 | |
| 105 base::TimeDelta | 111 base::TimeDelta |
| 106 FakeCompositorTimingHistory::BeginMainFrameToCommitDurationEstimate() const { | 112 FakeCompositorTimingHistory::BeginMainFrameToCommitDurationEstimate() const { |
| 107 return begin_main_frame_to_commit_duration_; | 113 return begin_main_frame_to_commit_duration_; |
| 108 } | 114 } |
| 109 | 115 |
| 110 base::TimeDelta FakeCompositorTimingHistory::CommitToActivateDurationEstimate() | 116 base::TimeDelta |
| 117 FakeCompositorTimingHistory::CommitToReadyToActivateDurationEstimate() const { |
| 118 return commit_to_ready_to_activate_duration_; |
| 119 } |
| 120 |
| 121 base::TimeDelta FakeCompositorTimingHistory::PrepareTilesDurationEstimate() |
| 111 const { | 122 const { |
| 112 return commit_to_activate_duration_; | 123 return prepare_tiles_duration_; |
| 124 } |
| 125 |
| 126 base::TimeDelta FakeCompositorTimingHistory::ActivateDurationEstimate() const { |
| 127 return activate_duration_; |
| 128 } |
| 129 |
| 130 base::TimeDelta FakeCompositorTimingHistory::DrawDurationEstimate() const { |
| 131 return draw_duration_; |
| 113 } | 132 } |
| 114 | 133 |
| 115 scoped_ptr<TestScheduler> TestScheduler::Create( | 134 scoped_ptr<TestScheduler> TestScheduler::Create( |
| 116 base::SimpleTestTickClock* now_src, | 135 base::SimpleTestTickClock* now_src, |
| 117 SchedulerClient* client, | 136 SchedulerClient* client, |
| 118 const SchedulerSettings& settings, | 137 const SchedulerSettings& settings, |
| 119 int layer_tree_host_id, | 138 int layer_tree_host_id, |
| 120 OrderedSimpleTaskRunner* task_runner, | 139 OrderedSimpleTaskRunner* task_runner, |
| 121 BeginFrameSource* external_frame_source, | 140 BeginFrameSource* external_frame_source, |
| 122 scoped_ptr<CompositorTimingHistory> compositor_timing_history) { | 141 scoped_ptr<CompositorTimingHistory> compositor_timing_history) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 174 } |
| 156 | 175 |
| 157 base::TimeTicks TestScheduler::Now() const { | 176 base::TimeTicks TestScheduler::Now() const { |
| 158 return now_src_->NowTicks(); | 177 return now_src_->NowTicks(); |
| 159 } | 178 } |
| 160 | 179 |
| 161 TestScheduler::~TestScheduler() { | 180 TestScheduler::~TestScheduler() { |
| 162 } | 181 } |
| 163 | 182 |
| 164 } // namespace cc | 183 } // namespace cc |
| OLD | NEW |