| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/debug/rasterize_and_record_benchmark.h" | 5 #include "cc/debug/rasterize_and_record_benchmark.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 timer.NextLap(); | 220 timer.NextLap(); |
| 221 } while (!timer.HasTimeLimitExpired()); | 221 } while (!timer.HasTimeLimitExpired()); |
| 222 base::TimeDelta duration = | 222 base::TimeDelta duration = |
| 223 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); | 223 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); |
| 224 if (duration < min_time) | 224 if (duration < min_time) |
| 225 min_time = duration; | 225 min_time = duration; |
| 226 } | 226 } |
| 227 | 227 |
| 228 record_results_.bytes_used += memory_used; | 228 if (mode_index == RecordingSource::RECORD_NORMALLY) { |
| 229 record_results_.pixels_recorded += | 229 record_results_.bytes_used += memory_used; |
| 230 visible_content_rect.width() * visible_content_rect.height(); | 230 record_results_.pixels_recorded += |
| 231 visible_content_rect.width() * visible_content_rect.height(); |
| 232 } |
| 231 record_results_.total_best_time[mode_index] += min_time; | 233 record_results_.total_best_time[mode_index] += min_time; |
| 232 } | 234 } |
| 233 } | 235 } |
| 234 | 236 |
| 235 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 237 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
| 236 : pixels_recorded(0), bytes_used(0) { | 238 : pixels_recorded(0), bytes_used(0) { |
| 237 } | 239 } |
| 238 | 240 |
| 239 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 241 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
| 240 | 242 |
| 241 } // namespace cc | 243 } // namespace cc |
| OLD | NEW |