Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(662)

Side by Side Diff: cc/resources/picture_pile_impl.cc

Issue 163413004: Add base::TimeDelta::Max(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | content/renderer/media/websourcebuffer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 ++it) { 406 ++it) {
408 Picture* picture = it->second.GetPicture(); 407 Picture* picture = it->second.GetPicture();
409 if (picture && (processed_pictures.count(picture) == 0)) { 408 if (picture && (processed_pictures.count(picture) == 0)) {
410 picture->EmitTraceSnapshot(); 409 picture->EmitTraceSnapshot();
411 processed_pictures.insert(picture); 410 processed_pictures.insert(picture);
412 } 411 }
413 } 412 }
414 } 413 }
415 414
416 } // namespace cc 415 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | content/renderer/media/websourcebuffer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698