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

Unified Diff: ui/views/view.h

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Resolving comments 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: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 7a8a7b327ebb5627de5a291fa7d0c06d35e3162e..7ac097f5102728ff4191743fabdead12176ff1fa 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -29,6 +29,7 @@
#include "ui/compositor/layer_delegate.h"
#include "ui/compositor/layer_owner.h"
#include "ui/compositor/paint_cache.h"
+#include "ui/compositor/paint_context.h"
#include "ui/events/event.h"
#include "ui/events/event_target.h"
#include "ui/gfx/geometry/insets.h"
@@ -1271,6 +1272,12 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// hierarchy).
virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) {}
+ // Pixel Canvas --------------------------------------------------------------
+
+ // Returns the type of scaling to be done for this View. Values should be from
+ // ui::PaintContext::ScaleType.
+ virtual ui::PaintContext::ScaleType GetContextScaleType() const;
+
// Debugging -----------------------------------------------------------------
#if !defined(NDEBUG)
@@ -1319,12 +1326,14 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// during painting.
bool ShouldPaint() const;
- // Returns the offset that should be used when constructing the paint context
+ // Returns the bounds that should be used when constructing the paint context
// for this view.
- gfx::Vector2d GetPaintContextOffset() const;
+ gfx::Rect GetPaintContextBounds() const;
// Adjusts the transform of |recorder| in advance of painting.
- void SetupTransformRecorderForPainting(ui::TransformRecorder* recorder) const;
+ void SetupTransformRecorderForPainting(
+ ui::TransformRecorder* recorder,
+ const gfx::Vector2d& offset_from_parent) const;
// Recursively calls the painting method |func| on all non-layered children,
// in Z order.

Powered by Google App Engine
This is Rietveld 408576698