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

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

Issue 179813009: Revert of Reland "Add base::TimeDelta::Max()" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/debug/rasterize_and_record_benchmark_impl.cc ('k') | cc/resources/picture_pile_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 "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
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::Max(); 231 base::TimeDelta best_duration = base::TimeDelta::FromInternalValue(
232 std::numeric_limits<int64>::max());
232 for (int i = 0; i < repeat_count; i++) { 233 for (int i = 0; i < repeat_count; i++) {
233 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 234 base::TimeTicks start_time = stats_instrumentation->StartRecording();
234 picture = Picture::Create(record_rect, 235 picture = Picture::Create(record_rect,
235 painter, 236 painter,
236 tile_grid_info_, 237 tile_grid_info_,
237 gather_pixel_refs, 238 gather_pixel_refs,
238 num_raster_threads); 239 num_raster_threads);
239 base::TimeDelta duration = 240 base::TimeDelta duration =
240 stats_instrumentation->EndRecording(start_time); 241 stats_instrumentation->EndRecording(start_time);
241 best_duration = std::min(duration, best_duration); 242 best_duration = std::min(duration, best_duration);
(...skipping 12 matching lines...) Expand all
254 info.SetPicture(picture); 255 info.SetPicture(picture);
255 } 256 }
256 } 257 }
257 } 258 }
258 259
259 UpdateRecordedRegion(); 260 UpdateRecordedRegion();
260 return true; 261 return true;
261 } 262 }
262 263
263 } // namespace cc 264 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/rasterize_and_record_benchmark_impl.cc ('k') | cc/resources/picture_pile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698