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

Unified Diff: ui/compositor/paint_context.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 | « ui/compositor/paint_context.h ('k') | ui/compositor/paint_recorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/paint_context.cc
diff --git a/ui/compositor/paint_context.cc b/ui/compositor/paint_context.cc
index b2b4fac54b39a4c19adb6b398cd1d3674d3a5e58..48e2e9d8f684440a72cb910557a3c2f6c482ae19 100644
--- a/ui/compositor/paint_context.cc
+++ b/ui/compositor/paint_context.cc
@@ -10,10 +10,14 @@ namespace ui {
PaintContext::PaintContext(cc::DisplayItemList* list,
float device_scale_factor,
- const gfx::Rect& invalidation)
+ const gfx::Rect& invalidation,
+ bool is_pixel_canvas)
: list_(list),
device_scale_factor_(device_scale_factor),
- invalidation_(invalidation) {
+ invalidation_(gfx::ScaleToRoundedRect(
+ invalidation,
+ is_pixel_canvas ? device_scale_factor_ : 1.f)),
+ is_pixel_canvas_(is_pixel_canvas) {
#if DCHECK_IS_ON()
root_visited_ = nullptr;
inside_paint_recorder_ = false;
@@ -25,7 +29,8 @@ PaintContext::PaintContext(const PaintContext& other,
: list_(other.list_),
device_scale_factor_(other.device_scale_factor_),
invalidation_(other.invalidation_),
- offset_(other.offset_ + offset) {
+ offset_(other.offset_ + offset),
+ is_pixel_canvas_(other.is_pixel_canvas_) {
#if DCHECK_IS_ON()
root_visited_ = other.root_visited_;
inside_paint_recorder_ = other.inside_paint_recorder_;
@@ -37,7 +42,8 @@ PaintContext::PaintContext(const PaintContext& other,
: list_(other.list_),
device_scale_factor_(other.device_scale_factor_),
invalidation_(),
- offset_(other.offset_) {
+ offset_(other.offset_),
+ is_pixel_canvas_(other.is_pixel_canvas_) {
#if DCHECK_IS_ON()
root_visited_ = other.root_visited_;
inside_paint_recorder_ = other.inside_paint_recorder_;
« no previous file with comments | « ui/compositor/paint_context.h ('k') | ui/compositor/paint_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698