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

Unified Diff: ui/views/view.h

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: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 7a8a7b327ebb5627de5a291fa7d0c06d35e3162e..92c332bd2e0f06912001263c87ab0682fe0d3ea5 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_info.h"
#include "ui/events/event.h"
#include "ui/events/event_target.h"
#include "ui/gfx/geometry/insets.h"
@@ -61,6 +62,7 @@ class InputMethod;
class Layer;
class NativeTheme;
class PaintContext;
+// class PaintInfo;
class ThemeProvider;
class TransformRecorder;
}
@@ -543,7 +545,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// for View coordinates and language direction as required, allows the View
// to paint itself via the various OnPaint*() event handlers and then paints
// the hierarchy beneath it.
- void Paint(const ui::PaintContext& parent_context);
+ void Paint(const ui::PaintInfo& parent_paint_info);
// The background object may be null.
void SetBackground(std::unique_ptr<Background> b);
@@ -1152,7 +1154,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Responsible for calling Paint() on child Views. Override to control the
// order child Views are painted.
- virtual void PaintChildren(const ui::PaintContext& context);
+ virtual void PaintChildren(const ui::PaintInfo& info);
// Override to provide rendering in any part of the View's bounds. Typically
// this is the "contents" of the view. If you override this method you will
@@ -1271,6 +1273,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::PaintInfo::ScaleType.
+ virtual ui::PaintInfo::ScaleType GetPaintScaleType() const;
+
// Debugging -----------------------------------------------------------------
#if !defined(NDEBUG)
@@ -1319,17 +1327,19 @@ 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 |PaintInfo|
// for this view.
- gfx::Vector2d GetPaintContextOffset() const;
+ gfx::Rect GetPaintRecordingBounds() 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.
- void RecursivePaintHelper(void (View::*func)(const ui::PaintContext&),
- const ui::PaintContext& context);
+ void RecursivePaintHelper(void (View::*func)(const ui::PaintInfo&),
+ const ui::PaintInfo& info);
// Invokes Paint() and, if necessary, PaintDebugRects(). Should be called
// only on the root of a widget/layer. PaintDebugRects() is invoked as a
@@ -1340,7 +1350,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Draws a semitransparent rect to indicate the bounds of this view.
// Recursively does the same for all children. Invoked only with
// --draw-view-bounds-rects.
- void PaintDebugRects(const ui::PaintContext& parent_context);
+ void PaintDebugRects(const ui::PaintInfo& paint_info);
// Tree operations -----------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698