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

Side by Side Diff: ui/views/view.h

Issue 2770603002: Add --draw-view-bounds-rects to draw bounds rects for all views. (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_VIEW_H_ 5 #ifndef UI_VIEWS_VIEW_H_
6 #define UI_VIEWS_VIEW_H_ 6 #define UI_VIEWS_VIEW_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 namespace ui { 55 namespace ui {
56 struct AXActionData; 56 struct AXActionData;
57 struct AXNodeData; 57 struct AXNodeData;
58 class Compositor; 58 class Compositor;
59 class InputMethod; 59 class InputMethod;
60 class Layer; 60 class Layer;
61 class NativeTheme; 61 class NativeTheme;
62 class PaintContext; 62 class PaintContext;
63 class ThemeProvider; 63 class ThemeProvider;
64 class TransformRecorder;
64 } 65 }
65 66
66 namespace views { 67 namespace views {
67 68
68 class Background; 69 class Background;
69 class Border; 70 class Border;
70 class ContextMenuController; 71 class ContextMenuController;
71 class DragController; 72 class DragController;
72 class FocusManager; 73 class FocusManager;
73 class FocusTraversable; 74 class FocusTraversable;
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 // system using necessary transformations. Returns whether the rect was 1390 // system using necessary transformations. Returns whether the rect was
1390 // successfully converted to the ancestor's coordinate system. 1391 // successfully converted to the ancestor's coordinate system.
1391 bool ConvertRectForAncestor(const View* ancestor, gfx::RectF* rect) const; 1392 bool ConvertRectForAncestor(const View* ancestor, gfx::RectF* rect) const;
1392 1393
1393 // Convert a rect in the ancestor's coordinate system to the view's 1394 // Convert a rect in the ancestor's coordinate system to the view's
1394 // coordinate system using necessary transformations. Returns whether the 1395 // coordinate system using necessary transformations. Returns whether the
1395 // rect was successfully converted from the ancestor's coordinate system 1396 // rect was successfully converted from the ancestor's coordinate system
1396 // to the view's coordinate system. 1397 // to the view's coordinate system.
1397 bool ConvertRectFromAncestor(const View* ancestor, gfx::RectF* rect) const; 1398 bool ConvertRectFromAncestor(const View* ancestor, gfx::RectF* rect) const;
1398 1399
1400 // Painting ------------------------------------------------------------------
sky 2017/03/22 15:26:05 There's already a section with this name on line 1
Peter Kasting 2017/03/22 21:39:11 Oh hey! I looked for that and missed it. Thanks.
1401
1402 // Returns true if this view should be painted, i.e. is visible and nonempty.
sky 2017/03/22 15:26:05 Can you make this comment more specific. It doesn'
Peter Kasting 2017/03/22 21:39:11 Done.
1403 bool ShouldPaint() const;
1404
1405 // Returns the offset that should be used when constructing the paint context
1406 // for this view.
1407 gfx::Vector2d GetPaintContextOffset() const;
1408
1409 // Adjusts the transform of |recorder| in advance of painting.
1410 void SetupTransformRecorderForPainting(ui::TransformRecorder* recorder) const;
1411
1412 // Recursively calls the painting method |func| on all non-layered children,
1413 // in Z order.
1414 void RecursivePaintHelper(void (View::*func)(const ui::PaintContext&),
1415 const ui::PaintContext& context);
1416
1417 // Invokes Paint() and, if necessary, PaintDebugRects(). Should be called
1418 // only on the root of a widget/layer. PaintDebugRects() is invoked as a
1419 // separate pass, instead of being rolled into Paint(), so that siblings will
1420 // not obscure debug rects.
1421 void PaintRoot(const ui::PaintContext& parent_context);
sky 2017/03/22 15:26:05 Generally a 'root' view refers to RootView. That i
Peter Kasting 2017/03/22 21:39:11 Done. I had the same concerns as you but couldn't
1422
1423 // Draws a semitransparent rect to indicate the bounds of this view.
1424 // Recursively does the same for all children. Invoked only with
1425 // --draw-view-bounds-rects.
1426 void PaintDebugRects(const ui::PaintContext& parent_context);
1427
1399 // Accelerated painting ------------------------------------------------------ 1428 // Accelerated painting ------------------------------------------------------
1400 1429
1401 // Creates the layer and related fields for this view. 1430 // Creates the layer and related fields for this view.
1402 void CreateLayer(ui::LayerType layer_type); 1431 void CreateLayer(ui::LayerType layer_type);
1403 1432
1404 // Recursively calls UpdateParentLayers() on all descendants, stopping at any 1433 // Recursively calls UpdateParentLayers() on all descendants, stopping at any
1405 // Views that have layers. Calls UpdateParentLayer() for any Views that have 1434 // Views that have layers. Calls UpdateParentLayer() for any Views that have
1406 // a layer with no parent. If at least one descendant had an unparented layer 1435 // a layer with no parent. If at least one descendant had an unparented layer
1407 // true is returned. 1436 // true is returned.
1408 bool UpdateParentLayers(); 1437 bool UpdateParentLayers();
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 // Observers ------------------------------------------------------------- 1669 // Observers -------------------------------------------------------------
1641 1670
1642 base::ObserverList<ViewObserver> observers_; 1671 base::ObserverList<ViewObserver> observers_;
1643 1672
1644 DISALLOW_COPY_AND_ASSIGN(View); 1673 DISALLOW_COPY_AND_ASSIGN(View);
1645 }; 1674 };
1646 1675
1647 } // namespace views 1676 } // namespace views
1648 1677
1649 #endif // UI_VIEWS_VIEW_H_ 1678 #endif // UI_VIEWS_VIEW_H_
OLDNEW
« 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