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

Unified Diff: cc/debug/rasterize_and_record_benchmark_impl.cc

Issue 2175553002: Raster PictureLayerTiling with fractional translation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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 523051116b912cb5d0169f6f1d8b681123ff99e6..09af5aef54e9b7563f7a5be7f99c40cf71accd4a 100644
--- a/cc/debug/rasterize_and_record_benchmark_impl.cc
+++ b/cc/debug/rasterize_and_record_benchmark_impl.cc
@@ -10,6 +10,7 @@
#include <limits>
#include "base/values.h"
+#include "cc/base/scale_translate2d.h"
#include "cc/debug/lap_timer.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/picture_layer_impl.h"
@@ -53,9 +54,10 @@ void RunBenchmark(RasterSource* raster_source,
content_rect.height()));
SkCanvas canvas(bitmap);
- raster_source->PlaybackToCanvas(&canvas, content_rect, content_rect,
- contents_scale,
- RasterSource::PlaybackSettings());
+ raster_source->PlaybackToCanvas(
+ &canvas, content_rect, content_rect,
+ ScaleTranslate2d(contents_scale, gfx::Vector2dF()),
+ RasterSource::PlaybackSettings());
timer.NextLap();
} while (!timer.HasTimeLimitExpired());
@@ -177,7 +179,7 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {
settings.skewport_extrapolation_limit_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();
@@ -187,7 +189,8 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {
DCHECK(*it);
gfx::Rect content_rect = (*it)->content_rect();
- float contents_scale = (*it)->contents_scale();
+ float contents_scale = (*it)->contents_transform().pre_scale();
+ DCHECK_EQ(1.f, contents_scale);
base::TimeDelta min_time;
bool is_solid_color = false;

Powered by Google App Engine
This is Rietveld 408576698