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

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

Issue 2563743004: [3/5] Add translated rasterization support for RasterBuffer & below (Closed)
Patch Set: rebase & fix last nits Created 3 years, 8 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
« no previous file with comments | « no previous file | cc/output/software_renderer.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 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/benchmarks/rasterize_and_record_benchmark_impl.h" 5 #include "cc/benchmarks/rasterize_and_record_benchmark_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
11 11
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "cc/base/lap_timer.h" 13 #include "cc/base/lap_timer.h"
14 #include "cc/layers/layer_impl.h" 14 #include "cc/layers/layer_impl.h"
15 #include "cc/layers/picture_layer_impl.h" 15 #include "cc/layers/picture_layer_impl.h"
16 #include "cc/raster/raster_buffer_provider.h" 16 #include "cc/raster/raster_buffer_provider.h"
17 #include "cc/trees/layer_tree_host_common.h" 17 #include "cc/trees/layer_tree_host_common.h"
18 #include "cc/trees/layer_tree_host_impl.h" 18 #include "cc/trees/layer_tree_host_impl.h"
19 #include "cc/trees/layer_tree_impl.h" 19 #include "cc/trees/layer_tree_impl.h"
20 #include "ui/gfx/geometry/axis_transform2d.h"
20 #include "ui/gfx/geometry/rect.h" 21 #include "ui/gfx/geometry/rect.h"
21 22
22 namespace cc { 23 namespace cc {
23 24
24 namespace { 25 namespace {
25 26
26 const int kDefaultRasterizeRepeatCount = 100; 27 const int kDefaultRasterizeRepeatCount = 100;
27 28
28 void RunBenchmark(RasterSource* raster_source, 29 void RunBenchmark(RasterSource* raster_source,
29 const gfx::Rect& content_rect, 30 const gfx::Rect& content_rect,
(...skipping 15 matching lines...) Expand all
45 kTimeCheckInterval); 46 kTimeCheckInterval);
46 SkColor color = SK_ColorTRANSPARENT; 47 SkColor color = SK_ColorTRANSPARENT;
47 *is_solid_color = raster_source->PerformSolidColorAnalysis( 48 *is_solid_color = raster_source->PerformSolidColorAnalysis(
48 content_rect, contents_scale, &color); 49 content_rect, contents_scale, &color);
49 50
50 do { 51 do {
51 SkBitmap bitmap; 52 SkBitmap bitmap;
52 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(), 53 bitmap.allocPixels(SkImageInfo::MakeN32Premul(content_rect.width(),
53 content_rect.height())); 54 content_rect.height()));
54 SkCanvas canvas(bitmap); 55 SkCanvas canvas(bitmap);
55 raster_source->PlaybackToCanvas(&canvas, gfx::ColorSpace(), content_rect, 56 raster_source->PlaybackToCanvas(
56 content_rect, contents_scale, 57 &canvas, gfx::ColorSpace(), content_rect, content_rect,
57 RasterSource::PlaybackSettings()); 58 gfx::AxisTransform2d(contents_scale, gfx::Vector2dF()),
59 RasterSource::PlaybackSettings());
58 60
59 timer.NextLap(); 61 timer.NextLap();
60 } while (!timer.HasTimeLimitExpired()); 62 } while (!timer.HasTimeLimitExpired());
61 base::TimeDelta duration = 63 base::TimeDelta duration =
62 base::TimeDelta::FromMillisecondsD(timer.MsPerLap()); 64 base::TimeDelta::FromMillisecondsD(timer.MsPerLap());
63 if (duration < *min_time) 65 if (duration < *min_time)
64 *min_time = duration; 66 *min_time = duration;
65 } 67 }
66 } 68 }
67 69
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 pixels_rasterized_as_opaque(0), 218 pixels_rasterized_as_opaque(0),
217 total_memory_usage(0), 219 total_memory_usage(0),
218 total_layers(0), 220 total_layers(0),
219 total_picture_layers(0), 221 total_picture_layers(0),
220 total_picture_layers_with_no_content(0), 222 total_picture_layers_with_no_content(0),
221 total_picture_layers_off_screen(0) {} 223 total_picture_layers_off_screen(0) {}
222 224
223 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} 225 RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {}
224 226
225 } // namespace cc 227 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698