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

Unified Diff: ui/compositor/paint_context.h

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/layer_owner_unittest.cc ('k') | ui/compositor/paint_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/paint_context.h
diff --git a/ui/compositor/paint_context.h b/ui/compositor/paint_context.h
index bc17c50f46bd3b00cee3ce9e83229b04704d12a9..96385275c4318a27aa8851ed3a0f1b5f3f19c35b 100644
--- a/ui/compositor/paint_context.h
+++ b/ui/compositor/paint_context.h
@@ -29,7 +29,8 @@ class COMPOSITOR_EXPORT PaintContext {
// |invalidation|.
PaintContext(cc::DisplayItemList* list,
float device_scale_factor,
- const gfx::Rect& invalidation);
+ const gfx::Rect& invalidation,
+ bool is_pixel_canvas);
// Clone a PaintContext with an additional |offset|.
PaintContext(const PaintContext& other, const gfx::Vector2d& offset);
@@ -46,6 +47,13 @@ class COMPOSITOR_EXPORT PaintContext {
// invalid.
bool CanCheckInvalid() const { return !invalidation_.IsEmpty(); }
+ // The device scale of the frame being painted.
+ float device_scale_factor() const { return device_scale_factor_; }
+
+ // Returns true if the paint commands are recorded at pixel size instead of
+ // DIP.
+ bool is_pixel_canvas() const { return is_pixel_canvas_; }
+
// When true, the |bounds| touches an invalidated area, so should be
// re-painted. When false, re-painting can be skipped. Bounds should be in
// the local space with offsets up to the painting root in the PaintContext.
@@ -94,6 +102,8 @@ class COMPOSITOR_EXPORT PaintContext {
// Offset from the PaintContext to the space of the paint root and the
// |invalidation_|.
gfx::Vector2d offset_;
+ // If enabled, the paint commands are recorded at pixel size.
+ const bool is_pixel_canvas_;
#if DCHECK_IS_ON()
// Used to verify that the |invalidation_| is only used to compare against
« no previous file with comments | « ui/compositor/layer_owner_unittest.cc ('k') | ui/compositor/paint_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698