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

Unified Diff: cc/raster/raster_source.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync With ToT 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 018356c91388073b3c3214ca1786a1301d176458..6026174dfef672e6dea38b97e297be5987687679 100644
--- a/cc/raster/raster_source.cc
+++ b/cc/raster/raster_source.cc
@@ -32,7 +32,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::PlaybackToCanvas(
@@ -54,7 +55,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();
}
@@ -198,6 +200,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') | ui/views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698