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 <algorithm> | 5 #include <algorithm> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "cc/base/region.h" | 9 #include "cc/base/region.h" |
10 #include "cc/debug/debug_colors.h" | 10 #include "cc/debug/debug_colors.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 ++it) { | 240 ++it) { |
241 Picture* picture = it->first; | 241 Picture* picture = it->first; |
242 Region negated_clip_region = it->second; | 242 Region negated_clip_region = it->second; |
243 | 243 |
244 #ifndef NDEBUG | 244 #ifndef NDEBUG |
245 Region positive_clip = content_rect; | 245 Region positive_clip = content_rect; |
246 positive_clip.Subtract(negated_clip_region); | 246 positive_clip.Subtract(negated_clip_region); |
247 total_clip.Union(positive_clip); | 247 total_clip.Union(positive_clip); |
248 #endif // NDEBUG | 248 #endif // NDEBUG |
249 | 249 |
250 base::TimeDelta best_duration = base::TimeDelta::Max(); | 250 base::TimeDelta best_duration = |
| 251 base::TimeDelta::FromInternalValue(std::numeric_limits<int64>::max()); |
251 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); | 252 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); |
252 int rasterized_pixel_count = 0; | 253 int rasterized_pixel_count = 0; |
253 | 254 |
254 for (int j = 0; j < repeat_count; ++j) { | 255 for (int j = 0; j < repeat_count; ++j) { |
255 base::TimeTicks start_time; | 256 base::TimeTicks start_time; |
256 if (rendering_stats_instrumentation) | 257 if (rendering_stats_instrumentation) |
257 start_time = rendering_stats_instrumentation->StartRecording(); | 258 start_time = rendering_stats_instrumentation->StartRecording(); |
258 | 259 |
259 rasterized_pixel_count = picture->Raster( | 260 rasterized_pixel_count = picture->Raster( |
260 canvas, callback, negated_clip_region, contents_scale); | 261 canvas, callback, negated_clip_region, contents_scale); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 ++it) { | 402 ++it) { |
402 Picture* picture = it->second.GetPicture(); | 403 Picture* picture = it->second.GetPicture(); |
403 if (picture && (processed_pictures.count(picture) == 0)) { | 404 if (picture && (processed_pictures.count(picture) == 0)) { |
404 picture->EmitTraceSnapshot(); | 405 picture->EmitTraceSnapshot(); |
405 processed_pictures.insert(picture); | 406 processed_pictures.insert(picture); |
406 } | 407 } |
407 } | 408 } |
408 } | 409 } |
409 | 410 |
410 } // namespace cc | 411 } // namespace cc |
OLD | NEW |