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

Unified Diff: cc/raster/raster_source.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 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
« no previous file with comments | « cc/raster/raster_source.h ('k') | cc/raster/raster_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/raster_source.cc
diff --git a/cc/raster/raster_source.cc b/cc/raster/raster_source.cc
index 3fc5d93175745a61285043b2a75bce67f6e489f6..61e66237b5a6806f4362b4f44709789e9d788298 100644
--- a/cc/raster/raster_source.cc
+++ b/cc/raster/raster_source.cc
@@ -33,7 +33,8 @@ RasterSource::RasterSource(const RecordingSource* other)
size_(other->size_),
clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_),
slow_down_raster_scale_factor_for_debug_(
- other->slow_down_raster_scale_factor_for_debug_) {}
+ other->slow_down_raster_scale_factor_for_debug_),
+ recording_scale_factor_(other->recording_scale_factor_) {}
RasterSource::~RasterSource() = default;
void RasterSource::SetupCanvasForRaster(
@@ -46,7 +47,8 @@ void RasterSource::SetupCanvasForRaster(
canvas->clipRect(gfx::RectToSkRect(canvas_playback_rect));
canvas->translate(raster_transform.translation().x(),
raster_transform.translation().y());
- canvas->scale(raster_transform.scale(), raster_transform.scale());
+ canvas->scale(raster_transform.scale() / recording_scale_factor_,
+ raster_transform.scale() / recording_scale_factor_);
if (should_clear_canvas)
ClearCanvasForPlayback(canvas);
@@ -186,6 +188,7 @@ bool RasterSource::PerformSolidColorAnalysis(gfx::Rect layer_rect,
TRACE_EVENT0("cc", "RasterSource::PerformSolidColorAnalysis");
layer_rect.Intersect(gfx::Rect(size_));
+ layer_rect = gfx::ScaleToRoundedRect(layer_rect, recording_scale_factor_);
return display_list_->GetColorIfSolidInRect(layer_rect, color);
}
« no previous file with comments | « cc/raster/raster_source.h ('k') | cc/raster/raster_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698