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

Unified Diff: ui/views/view.h

Issue 2770603002: Add --draw-view-bounds-rects to draw bounds rects for all views. (Closed)
Patch Set: Review comments Created 3 years, 9 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 | « no previous file | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index d719730b70f9792edd55686791daa2772292c031..bfa107c7eb59451d32fd8c211537fb1c21eda3d0 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -61,6 +61,7 @@ class Layer;
class NativeTheme;
class PaintContext;
class ThemeProvider;
+class TransformRecorder;
}
namespace views {
@@ -1291,6 +1292,35 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Schedules a paint on the parent View if it exists.
void SchedulePaintOnParent();
+ // Returns whether this view is eligible for painting, i.e. is visible and
+ // nonempty. Note that this does not behave like IsDrawn(), since it doesn't
+ // check ancestors recursively; rather, it's used to prune subtrees of views
+ // during painting.
+ bool ShouldPaint() const;
+
+ // Returns the offset that should be used when constructing the paint context
+ // for this view.
+ gfx::Vector2d GetPaintContextOffset() const;
+
+ // Adjusts the transform of |recorder| in advance of painting.
+ void SetupTransformRecorderForPainting(ui::TransformRecorder* recorder) 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);
+
+ // Invokes Paint() and, if necessary, PaintDebugRects(). Should be called
+ // only on the root of a widget/layer. PaintDebugRects() is invoked as a
+ // separate pass, instead of being rolled into Paint(), so that siblings will
+ // not obscure debug rects.
+ void PaintFromPaintRoot(const ui::PaintContext& parent_context);
+
+ // 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);
+
// Tree operations -----------------------------------------------------------
// Removes |view| from the hierarchy tree. If |update_focus_cycle| is true,
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698