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

Unified Diff: cc/debug/rasterize_and_record_benchmark_impl.cc

Issue 2566613002: [4/5] Add translated rasterization support for PictureLayerTilingSet & below (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.cc » ('j') | cc/tiles/picture_layer_tiling.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/rasterize_and_record_benchmark_impl.cc
diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/debug/rasterize_and_record_benchmark_impl.cc
index 7e061296c4a4e0aaca90612af72184d7ea0222c4..bd2e2b7100353ab86cb5012fc60dc53ed1bb9e75 100644
--- a/cc/debug/rasterize_and_record_benchmark_impl.cc
+++ b/cc/debug/rasterize_and_record_benchmark_impl.cc
@@ -28,7 +28,7 @@ const int kDefaultRasterizeRepeatCount = 100;
void RunBenchmark(RasterSource* raster_source,
const gfx::Rect& content_rect,
- const gfx::SizeF& raster_scales,
+ float raster_scale,
size_t repeat_count,
base::TimeDelta* min_time,
bool* is_solid_color) {
@@ -46,7 +46,7 @@ void RunBenchmark(RasterSource* raster_source,
kTimeCheckInterval);
SkColor color = SK_ColorTRANSPARENT;
*is_solid_color = raster_source->PerformSolidColorAnalysis(
- content_rect, raster_scales, &color);
+ content_rect, raster_scale, &color);
do {
SkBitmap bitmap;
@@ -54,9 +54,8 @@ void RunBenchmark(RasterSource* raster_source,
content_rect.height()));
SkCanvas canvas(bitmap);
- DCHECK_EQ(raster_scales.width(), raster_scales.height());
raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect,
- ScaleTranslate2d(raster_scales.width(), gfx::Vector2dF()),
+ ScaleTranslate2d(raster_scale, gfx::Vector2dF()),
RasterSource::PlaybackSettings());
timer.NextLap();
@@ -180,7 +179,7 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {
settings.max_preraster_distance_in_screen_pixels);
PictureLayerTiling* tiling =
- tiling_set->AddTiling(1.f, layer->GetRasterSource());
+ tiling_set->AddTiling(ScaleTranslate2d(), layer->GetRasterSource());
tiling->set_resolution(HIGH_RESOLUTION);
tiling->CreateAllTilesForTesting();
RasterSource* raster_source = tiling->raster_source().get();
@@ -190,11 +189,12 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {
DCHECK(*it);
gfx::Rect content_rect = (*it)->content_rect();
- const gfx::SizeF& raster_scales = (*it)->raster_scales();
+ float raster_scale = (*it)->raster_transform().scale();
+ DCHECK_EQ(1.f, raster_scale);
base::TimeDelta min_time;
bool is_solid_color = false;
- RunBenchmark(raster_source, content_rect, raster_scales,
+ RunBenchmark(raster_source, content_rect, raster_scale,
rasterize_repeat_count_, &min_time, &is_solid_color);
int tile_size = content_rect.width() * content_rect.height();
« no previous file with comments | « no previous file | cc/layers/picture_layer_impl.cc » ('j') | cc/tiles/picture_layer_tiling.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698