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