| 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/resources/picture_pile.h" | 5 #include "cc/resources/picture_pile.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 scoped_refptr<Picture> picture; | 221 scoped_refptr<Picture> picture; |
| 222 int num_raster_threads = RasterWorkerPool::GetNumRasterThreads(); | 222 int num_raster_threads = RasterWorkerPool::GetNumRasterThreads(); |
| 223 | 223 |
| 224 // Note: Currently, gathering of pixel refs when using a single | 224 // Note: Currently, gathering of pixel refs when using a single |
| 225 // raster thread doesn't provide any benefit. This might change | 225 // raster thread doesn't provide any benefit. This might change |
| 226 // in the future but we avoid it for now to reduce the cost of | 226 // in the future but we avoid it for now to reduce the cost of |
| 227 // Picture::Create. | 227 // Picture::Create. |
| 228 bool gather_pixel_refs = num_raster_threads > 1; | 228 bool gather_pixel_refs = num_raster_threads > 1; |
| 229 | 229 |
| 230 { | 230 { |
| 231 base::TimeDelta best_duration = base::TimeDelta::FromInternalValue( | 231 base::TimeDelta best_duration = base::TimeDelta::Max(); |
| 232 std::numeric_limits<int64>::max()); | |
| 233 for (int i = 0; i < repeat_count; i++) { | 232 for (int i = 0; i < repeat_count; i++) { |
| 234 base::TimeTicks start_time = stats_instrumentation->StartRecording(); | 233 base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
| 235 picture = Picture::Create(record_rect, | 234 picture = Picture::Create(record_rect, |
| 236 painter, | 235 painter, |
| 237 tile_grid_info_, | 236 tile_grid_info_, |
| 238 gather_pixel_refs, | 237 gather_pixel_refs, |
| 239 num_raster_threads); | 238 num_raster_threads); |
| 240 base::TimeDelta duration = | 239 base::TimeDelta duration = |
| 241 stats_instrumentation->EndRecording(start_time); | 240 stats_instrumentation->EndRecording(start_time); |
| 242 best_duration = std::min(duration, best_duration); | 241 best_duration = std::min(duration, best_duration); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 255 info.SetPicture(picture); | 254 info.SetPicture(picture); |
| 256 } | 255 } |
| 257 } | 256 } |
| 258 } | 257 } |
| 259 | 258 |
| 260 UpdateRecordedRegion(); | 259 UpdateRecordedRegion(); |
| 261 return true; | 260 return true; |
| 262 } | 261 } |
| 263 | 262 |
| 264 } // namespace cc | 263 } // namespace cc |
| OLD | NEW |