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 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 return scheduler->unthrottled_frame_source_internal_.get(); | 110 return scheduler->unthrottled_frame_source_internal_.get(); |
111 } | 111 } |
112 | 112 |
113 TestScheduler::TestScheduler( | 113 TestScheduler::TestScheduler( |
114 base::SimpleTestTickClock* now_src, | 114 base::SimpleTestTickClock* now_src, |
115 SchedulerClient* client, | 115 SchedulerClient* client, |
116 const SchedulerSettings& scheduler_settings, | 116 const SchedulerSettings& scheduler_settings, |
117 int layer_tree_host_id, | 117 int layer_tree_host_id, |
118 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, | 118 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, |
119 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, | 119 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, |
120 scoped_ptr<BeginFrameSource> external_begin_frame_source) | 120 scoped_ptr<BeginFrameSource> external_begin_frame_source, |
| 121 RenderingStatsInstrumentation* rendering_stats_instrumentation) |
121 : Scheduler(client, | 122 : Scheduler(client, |
122 scheduler_settings, | 123 scheduler_settings, |
123 layer_tree_host_id, | 124 layer_tree_host_id, |
124 test_task_runner, | 125 test_task_runner, |
125 external_begin_frame_source.Pass(), | 126 external_begin_frame_source.Pass(), |
| 127 rendering_stats_instrumentation, |
126 frame_sources_constructor), | 128 frame_sources_constructor), |
127 now_src_(now_src) { | 129 now_src_(now_src) { |
128 } | 130 } |
129 | 131 |
130 base::TimeTicks TestScheduler::Now() const { | 132 base::TimeTicks TestScheduler::Now() const { |
131 return now_src_->NowTicks(); | 133 return now_src_->NowTicks(); |
132 } | 134 } |
133 | 135 |
| 136 void TestScheduler::SetDrawDurationEstimate(base::TimeDelta duration) { |
| 137 draw_duration_ = duration; |
| 138 } |
| 139 |
| 140 void TestScheduler::SetBeginMainFrameToCommitDurationEstimate( |
| 141 base::TimeDelta duration) { |
| 142 begin_main_frame_to_commit_duration_ = duration; |
| 143 } |
| 144 |
| 145 void TestScheduler::SetPrepareTilesToReadyToActivateDurationEstimate( |
| 146 base::TimeDelta duration) { |
| 147 commit_to_activate_duration_ = duration; |
| 148 } |
| 149 |
| 150 base::TimeDelta TestScheduler::BeginMainFrameToCommitDurationEstimate() const { |
| 151 return begin_main_frame_to_commit_duration_; |
| 152 } |
| 153 |
| 154 base::TimeDelta TestScheduler::PrepareTilesToReadyToActivateDurationEstimate() |
| 155 const { |
| 156 return commit_to_activate_duration_; |
| 157 } |
| 158 |
| 159 base::TimeDelta TestScheduler::ActivateDurationEstimate() const { |
| 160 return base::TimeDelta(); |
| 161 } |
| 162 |
| 163 base::TimeDelta TestScheduler::DrawDurationEstimate() const { |
| 164 return draw_duration_; |
| 165 } |
| 166 |
134 TestScheduler::~TestScheduler() { | 167 TestScheduler::~TestScheduler() { |
135 } | 168 } |
136 | 169 |
137 } // namespace cc | 170 } // namespace cc |
OLD | NEW |