| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 : CompositorTimingHistory(CompositorTimingHistory::NULL_UMA, | 78 : CompositorTimingHistory(CompositorTimingHistory::NULL_UMA, |
| 79 rendering_stats_instrumentation.get()), | 79 rendering_stats_instrumentation.get()), |
| 80 rendering_stats_instrumentation_owned_( | 80 rendering_stats_instrumentation_owned_( |
| 81 rendering_stats_instrumentation.Pass()) {} | 81 rendering_stats_instrumentation.Pass()) {} |
| 82 | 82 |
| 83 FakeCompositorTimingHistory::~FakeCompositorTimingHistory() { | 83 FakeCompositorTimingHistory::~FakeCompositorTimingHistory() { |
| 84 } | 84 } |
| 85 | 85 |
| 86 void FakeCompositorTimingHistory::SetAllEstimatesTo(base::TimeDelta duration) { | 86 void FakeCompositorTimingHistory::SetAllEstimatesTo(base::TimeDelta duration) { |
| 87 begin_main_frame_to_commit_duration_ = duration; | 87 begin_main_frame_to_commit_duration_ = duration; |
| 88 begin_main_frame_queue_duration_critical_ = duration; |
| 89 begin_main_frame_queue_duration_not_critical_ = duration; |
| 90 begin_main_frame_start_to_commit_duration_ = duration; |
| 88 commit_to_ready_to_activate_duration_ = duration; | 91 commit_to_ready_to_activate_duration_ = duration; |
| 89 prepare_tiles_duration_ = duration; | 92 prepare_tiles_duration_ = duration; |
| 90 activate_duration_ = duration; | 93 activate_duration_ = duration; |
| 91 draw_duration_ = duration; | 94 draw_duration_ = duration; |
| 92 } | 95 } |
| 93 | 96 |
| 94 void FakeCompositorTimingHistory::SetBeginMainFrameToCommitDurationEstimate( | 97 void FakeCompositorTimingHistory::SetBeginMainFrameToCommitDurationEstimate( |
| 95 base::TimeDelta duration) { | 98 base::TimeDelta duration) { |
| 96 begin_main_frame_to_commit_duration_ = duration; | 99 begin_main_frame_to_commit_duration_ = duration; |
| 97 } | 100 } |
| 98 | 101 |
| 102 void FakeCompositorTimingHistory:: |
| 103 SetBeginMainFrameQueueDurationCriticalEstimate(base::TimeDelta duration) { |
| 104 begin_main_frame_queue_duration_critical_ = duration; |
| 105 } |
| 106 |
| 107 void FakeCompositorTimingHistory:: |
| 108 SetBeginMainFrameQueueDurationNotCriticalEstimate( |
| 109 base::TimeDelta duration) { |
| 110 begin_main_frame_queue_duration_not_critical_ = duration; |
| 111 } |
| 112 |
| 113 void FakeCompositorTimingHistory:: |
| 114 SetBeginMainFrameStartToCommitDurationEstimate(base::TimeDelta duration) { |
| 115 begin_main_frame_start_to_commit_duration_ = duration; |
| 116 } |
| 117 |
| 99 void FakeCompositorTimingHistory::SetCommitToReadyToActivateDurationEstimate( | 118 void FakeCompositorTimingHistory::SetCommitToReadyToActivateDurationEstimate( |
| 100 base::TimeDelta duration) { | 119 base::TimeDelta duration) { |
| 101 commit_to_ready_to_activate_duration_ = duration; | 120 commit_to_ready_to_activate_duration_ = duration; |
| 102 } | 121 } |
| 103 | 122 |
| 104 void FakeCompositorTimingHistory::SetPrepareTilesDurationEstimate( | 123 void FakeCompositorTimingHistory::SetPrepareTilesDurationEstimate( |
| 105 base::TimeDelta duration) { | 124 base::TimeDelta duration) { |
| 106 prepare_tiles_duration_ = duration; | 125 prepare_tiles_duration_ = duration; |
| 107 } | 126 } |
| 108 | 127 |
| 109 void FakeCompositorTimingHistory::SetActivateDurationEstimate( | 128 void FakeCompositorTimingHistory::SetActivateDurationEstimate( |
| 110 base::TimeDelta duration) { | 129 base::TimeDelta duration) { |
| 111 activate_duration_ = duration; | 130 activate_duration_ = duration; |
| 112 } | 131 } |
| 113 | 132 |
| 114 void FakeCompositorTimingHistory::SetDrawDurationEstimate( | 133 void FakeCompositorTimingHistory::SetDrawDurationEstimate( |
| 115 base::TimeDelta duration) { | 134 base::TimeDelta duration) { |
| 116 draw_duration_ = duration; | 135 draw_duration_ = duration; |
| 117 } | 136 } |
| 118 | 137 |
| 119 base::TimeDelta | 138 base::TimeDelta |
| 120 FakeCompositorTimingHistory::BeginMainFrameToCommitDurationEstimate() const { | 139 FakeCompositorTimingHistory::BeginMainFrameToCommitDurationEstimate() const { |
| 121 return begin_main_frame_to_commit_duration_; | 140 return begin_main_frame_to_commit_duration_; |
| 122 } | 141 } |
| 123 | 142 |
| 124 base::TimeDelta | 143 base::TimeDelta |
| 144 FakeCompositorTimingHistory::BeginMainFrameQueueDurationCriticalEstimate() |
| 145 const { |
| 146 return begin_main_frame_queue_duration_critical_; |
| 147 } |
| 148 |
| 149 base::TimeDelta |
| 150 FakeCompositorTimingHistory::BeginMainFrameQueueDurationNotCriticalEstimate() |
| 151 const { |
| 152 return begin_main_frame_queue_duration_not_critical_; |
| 153 } |
| 154 |
| 155 base::TimeDelta |
| 156 FakeCompositorTimingHistory::BeginMainFrameStartToCommitDurationEstimate() |
| 157 const { |
| 158 return begin_main_frame_start_to_commit_duration_; |
| 159 } |
| 160 |
| 161 base::TimeDelta |
| 125 FakeCompositorTimingHistory::CommitToReadyToActivateDurationEstimate() const { | 162 FakeCompositorTimingHistory::CommitToReadyToActivateDurationEstimate() const { |
| 126 return commit_to_ready_to_activate_duration_; | 163 return commit_to_ready_to_activate_duration_; |
| 127 } | 164 } |
| 128 | 165 |
| 129 base::TimeDelta FakeCompositorTimingHistory::PrepareTilesDurationEstimate() | 166 base::TimeDelta FakeCompositorTimingHistory::PrepareTilesDurationEstimate() |
| 130 const { | 167 const { |
| 131 return prepare_tiles_duration_; | 168 return prepare_tiles_duration_; |
| 132 } | 169 } |
| 133 | 170 |
| 134 base::TimeDelta FakeCompositorTimingHistory::ActivateDurationEstimate() const { | 171 base::TimeDelta FakeCompositorTimingHistory::ActivateDurationEstimate() const { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 219 } |
| 183 | 220 |
| 184 base::TimeTicks TestScheduler::Now() const { | 221 base::TimeTicks TestScheduler::Now() const { |
| 185 return now_src_->NowTicks(); | 222 return now_src_->NowTicks(); |
| 186 } | 223 } |
| 187 | 224 |
| 188 TestScheduler::~TestScheduler() { | 225 TestScheduler::~TestScheduler() { |
| 189 } | 226 } |
| 190 | 227 |
| 191 } // namespace cc | 228 } // namespace cc |
| OLD | NEW |