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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 scoped_refptr<DisplayItemList> display_list; | 200 scoped_refptr<DisplayItemList> display_list; |
201 for (int i = 0; i < record_repeat_count_; ++i) { | 201 for (int i = 0; i < record_repeat_count_; ++i) { |
202 // Run for a minimum amount of time to avoid problems with timer | 202 // Run for a minimum amount of time to avoid problems with timer |
203 // quantization when the layer is very small. | 203 // quantization when the layer is very small. |
204 LapTimer timer(kWarmupRuns, | 204 LapTimer timer(kWarmupRuns, |
205 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 205 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
206 kTimeCheckInterval); | 206 kTimeCheckInterval); |
207 | 207 |
208 do { | 208 do { |
209 display_list = painter->PaintContentsToDisplayList(visible_layer_rect, | 209 const bool use_cached_picture = true; |
210 painting_control); | 210 display_list = |
| 211 DisplayItemList::Create(visible_layer_rect, use_cached_picture); |
| 212 painter->PaintContentsToDisplayList( |
| 213 display_list.get(), visible_layer_rect, painting_control); |
211 display_list->CreateAndCacheSkPicture(); | 214 display_list->CreateAndCacheSkPicture(); |
212 | 215 |
213 if (memory_used) { | 216 if (memory_used) { |
214 // Verify we are recording the same thing each time. | 217 // Verify we are recording the same thing each time. |
215 DCHECK(memory_used == display_list->PictureMemoryUsage()); | 218 DCHECK(memory_used == display_list->PictureMemoryUsage()); |
216 } else { | 219 } else { |
217 memory_used = display_list->PictureMemoryUsage(); | 220 memory_used = display_list->PictureMemoryUsage(); |
218 } | 221 } |
219 | 222 |
220 timer.NextLap(); | 223 timer.NextLap(); |
(...skipping 13 matching lines...) Expand all Loading... |
234 } | 237 } |
235 } | 238 } |
236 | 239 |
237 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 240 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
238 : pixels_recorded(0), bytes_used(0) { | 241 : pixels_recorded(0), bytes_used(0) { |
239 } | 242 } |
240 | 243 |
241 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 244 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
242 | 245 |
243 } // namespace cc | 246 } // namespace cc |
OLD | NEW |