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

Side by Side Diff: cc/debug/rasterize_and_record_benchmark_impl.cc

Issue 706203003: Update from https://crrev.com/303153 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « cc/debug/paint_time_counter.cc ('k') | cc/debug/rendering_stats.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/debug/rasterize_and_record_benchmark_impl.h" 5 #include "cc/debug/rasterize_and_record_benchmark_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 LapTimer timer(kWarmupRuns, 49 LapTimer timer(kWarmupRuns,
50 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), 50 base::TimeDelta::FromMilliseconds(kTimeLimitMillis),
51 kTimeCheckInterval); 51 kTimeCheckInterval);
52 do { 52 do {
53 SkBitmap bitmap; 53 SkBitmap bitmap;
54 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect_.width(), 54 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect_.width(),
55 content_rect_.height())); 55 content_rect_.height()));
56 SkCanvas canvas(bitmap); 56 SkCanvas canvas(bitmap);
57 RasterSource::SolidColorAnalysis analysis; 57 RasterSource::SolidColorAnalysis analysis;
58 58
59 raster_source_->PerformSolidColorAnalysis( 59 raster_source_->PerformSolidColorAnalysis(content_rect_,
60 content_rect_, contents_scale_, &analysis, nullptr); 60 contents_scale_, &analysis);
61 raster_source_->PlaybackToCanvas( 61 raster_source_->PlaybackToCanvas(&canvas, content_rect_,
62 &canvas, content_rect_, contents_scale_, nullptr); 62 contents_scale_);
63 63
64 is_solid_color_ = analysis.is_solid_color; 64 is_solid_color_ = analysis.is_solid_color;
65 65
66 timer.NextLap(); 66 timer.NextLap();
67 } while (!timer.HasTimeLimitExpired()); 67 } while (!timer.HasTimeLimitExpired());
68 base::TimeDelta duration = 68 base::TimeDelta duration =
69 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); 69 base::TimeDelta::FromMillisecondsD(timer.MsPerLap());
70 if (duration < best_time_) 70 if (duration < best_time_)
71 best_time_ = duration; 71 best_time_ = duration;
72 } 72 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 pixels_rasterized_with_non_solid_color(0), 270 pixels_rasterized_with_non_solid_color(0),
271 pixels_rasterized_as_opaque(0), 271 pixels_rasterized_as_opaque(0),
272 total_layers(0), 272 total_layers(0),
273 total_picture_layers(0), 273 total_picture_layers(0),
274 total_picture_layers_with_no_content(0), 274 total_picture_layers_with_no_content(0),
275 total_picture_layers_off_screen(0) {} 275 total_picture_layers_off_screen(0) {}
276 276
277 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} 277 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {}
278 278
279 } // namespace cc 279 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/paint_time_counter.cc ('k') | cc/debug/rendering_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698