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 = | 250 base::TimeDelta best_duration = base::TimeDelta::Max(); |
251 base::TimeDelta::FromInternalValue(std::numeric_limits<int64>::max()); | |
252 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); | 251 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); |
253 int rasterized_pixel_count = 0; | 252 int rasterized_pixel_count = 0; |
254 | 253 |
255 for (int j = 0; j < repeat_count; ++j) { | 254 for (int j = 0; j < repeat_count; ++j) { |
256 base::TimeTicks start_time; | 255 base::TimeTicks start_time; |
257 if (rendering_stats_instrumentation) | 256 if (rendering_stats_instrumentation) |
258 start_time = rendering_stats_instrumentation->StartRecording(); | 257 start_time = rendering_stats_instrumentation->StartRecording(); |
259 | 258 |
260 rasterized_pixel_count = picture->Raster( | 259 rasterized_pixel_count = picture->Raster( |
261 canvas, callback, negated_clip_region, contents_scale); | 260 canvas, callback, negated_clip_region, contents_scale); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 ++it) { | 401 ++it) { |
403 Picture* picture = it->second.GetPicture(); | 402 Picture* picture = it->second.GetPicture(); |
404 if (picture && (processed_pictures.count(picture) == 0)) { | 403 if (picture && (processed_pictures.count(picture) == 0)) { |
405 picture->EmitTraceSnapshot(); | 404 picture->EmitTraceSnapshot(); |
406 processed_pictures.insert(picture); | 405 processed_pictures.insert(picture); |
407 } | 406 } |
408 } | 407 } |
409 } | 408 } |
410 | 409 |
411 } // namespace cc | 410 } // namespace cc |
OLD | NEW |