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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 LapTimer timer(kWarmupRuns, | 216 LapTimer timer(kWarmupRuns, |
217 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 217 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
218 kTimeCheckInterval); | 218 kTimeCheckInterval); |
219 | 219 |
220 do { | 220 do { |
221 display_list = painter->PaintContentsToDisplayList(visible_layer_rect, | 221 display_list = painter->PaintContentsToDisplayList(visible_layer_rect, |
222 painting_control); | 222 painting_control); |
223 | 223 |
224 if (memory_used) { | 224 if (memory_used) { |
225 // Verify we are recording the same thing each time. | 225 // Verify we are recording the same thing each time. |
226 DCHECK(memory_used == display_list->PictureMemoryUsage()); | 226 DCHECK(memory_used == display_list->ApproximateMemoryUsage()); |
enne (OOO)
2015/07/07 21:12:37
DCHECK_EQ?
jbroman
2015/07/07 21:39:03
Haha, the hazards of modifying an existing line of
| |
227 } else { | 227 } else { |
228 memory_used = display_list->PictureMemoryUsage(); | 228 memory_used = display_list->ApproximateMemoryUsage(); |
229 } | 229 } |
230 | 230 |
231 timer.NextLap(); | 231 timer.NextLap(); |
232 } while (!timer.HasTimeLimitExpired()); | 232 } while (!timer.HasTimeLimitExpired()); |
233 base::TimeDelta duration = | 233 base::TimeDelta duration = |
234 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); | 234 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); |
235 if (duration < min_time) | 235 if (duration < min_time) |
236 min_time = duration; | 236 min_time = duration; |
237 } | 237 } |
238 | 238 |
239 if (mode_index == RecordingSource::RECORD_NORMALLY) { | 239 if (mode_index == RecordingSource::RECORD_NORMALLY) { |
240 record_results_.bytes_used += memory_used; | 240 record_results_.bytes_used += memory_used; |
241 record_results_.pixels_recorded += | 241 record_results_.pixels_recorded += |
242 visible_layer_rect.width() * visible_layer_rect.height(); | 242 visible_layer_rect.width() * visible_layer_rect.height(); |
243 } | 243 } |
244 record_results_.total_best_time[mode_index] += min_time; | 244 record_results_.total_best_time[mode_index] += min_time; |
245 } | 245 } |
246 } | 246 } |
247 | 247 |
248 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 248 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
249 : pixels_recorded(0), bytes_used(0) { | 249 : pixels_recorded(0), bytes_used(0) { |
250 } | 250 } |
251 | 251 |
252 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 252 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
253 | 253 |
254 } // namespace cc | 254 } // namespace cc |
OLD | NEW |