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

Unified Diff: cc/raster/raster_source.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Update tests Created 3 years, 5 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/raster/raster_source.cc
diff --git a/cc/raster/raster_source.cc b/cc/raster/raster_source.cc
index 124d5c5674eaa511e9880aa0c3373c326ae60cbf..089a9620d475e12aae78095f89118660acc019f0 100644
--- a/cc/raster/raster_source.cc
+++ b/cc/raster/raster_source.cc
@@ -42,6 +42,7 @@ RasterSource::RasterSource(const RecordingSource* other, bool can_use_lcd_text)
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_),
+ recording_scale_factor_(other->recording_scale_factor_),
image_decode_cache_(nullptr) {}
RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text)
@@ -57,6 +58,7 @@ RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text)
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_),
+ recording_scale_factor_(other->recording_scale_factor_),
image_decode_cache_(other->image_decode_cache_) {}
RasterSource::~RasterSource() {}
@@ -80,7 +82,8 @@ void RasterSource::PlaybackToCanvas(
raster_canvas->clipRect(SkRect::MakeFromIRect(raster_bounds));
raster_canvas->translate(raster_transform.translation().x(),
raster_transform.translation().y());
- raster_canvas->scale(raster_transform.scale(), raster_transform.scale());
+ raster_canvas->scale(raster_transform.scale() / recording_scale_factor_,
+ raster_transform.scale() / recording_scale_factor_);
PlaybackToCanvas(raster_canvas, target_color_space, settings);
raster_canvas->restore();
}
@@ -242,6 +245,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);
}

Powered by Google App Engine
This is Rietveld 408576698