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

Side by Side Diff: Source/core/paint/TableCellPainter.h

Issue 1319893002: Make classes and structures in core/paint fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 TableCellPainter_h 5 #ifndef TableCellPainter_h
6 #define TableCellPainter_h 6 #define TableCellPainter_h
7 7
8 #include "core/style/CollapsedBorderValue.h" 8 #include "core/style/CollapsedBorderValue.h"
9 #include "wtf/Allocator.h"
9 10
10 namespace blink { 11 namespace blink {
11 12
12 struct PaintInfo; 13 struct PaintInfo;
13 class LayoutPoint; 14 class LayoutPoint;
14 class LayoutRect; 15 class LayoutRect;
15 class LayoutTableCell; 16 class LayoutTableCell;
16 class LayoutObject; 17 class LayoutObject;
17 class ComputedStyle; 18 class ComputedStyle;
18 19
19 class TableCellPainter { 20 class TableCellPainter {
21 STACK_ALLOCATED();
20 public: 22 public:
21 TableCellPainter(LayoutTableCell& layoutTableCell) : m_layoutTableCell(layou tTableCell) { } 23 TableCellPainter(LayoutTableCell& layoutTableCell) : m_layoutTableCell(layou tTableCell) { }
22 24
23 void paint(const PaintInfo&, const LayoutPoint&); 25 void paint(const PaintInfo&, const LayoutPoint&);
24 26
25 void paintCollapsedBorders(const PaintInfo&, const LayoutPoint&); 27 void paintCollapsedBorders(const PaintInfo&, const LayoutPoint&);
26 void paintBackgroundsBehindCell(const PaintInfo&, const LayoutPoint&, Layout Object* backgroundObject); 28 void paintBackgroundsBehindCell(const PaintInfo&, const LayoutPoint&, Layout Object* backgroundObject);
27 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint& paint Offset); 29 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint& paint Offset);
28 void paintMask(const PaintInfo&, const LayoutPoint& paintOffset); 30 void paintMask(const PaintInfo&, const LayoutPoint& paintOffset);
29 31
30 enum PaintBoundOffsetBehavior { AddOffsetFromParent, DoNotAddOffsetFromParen t }; 32 enum PaintBoundOffsetBehavior { AddOffsetFromParent, DoNotAddOffsetFromParen t };
31 // Returns the bonds of the table cell for painting, offset by paintOffset, and if desired, the offset from the cell 33 // Returns the bonds of the table cell for painting, offset by paintOffset, and if desired, the offset from the cell
32 // to its parent. 34 // to its parent.
33 LayoutRect paintBounds(const LayoutPoint& paintOffset, PaintBoundOffsetBehav ior); 35 LayoutRect paintBounds(const LayoutPoint& paintOffset, PaintBoundOffsetBehav ior);
34 36
35 private: 37 private:
36 const CollapsedBorderValue& cachedCollapsedLeftBorder(const ComputedStyle&) const; 38 const CollapsedBorderValue& cachedCollapsedLeftBorder(const ComputedStyle&) const;
37 const CollapsedBorderValue& cachedCollapsedRightBorder(const ComputedStyle&) const; 39 const CollapsedBorderValue& cachedCollapsedRightBorder(const ComputedStyle&) const;
38 const CollapsedBorderValue& cachedCollapsedTopBorder(const ComputedStyle&) c onst; 40 const CollapsedBorderValue& cachedCollapsedTopBorder(const ComputedStyle&) c onst;
39 const CollapsedBorderValue& cachedCollapsedBottomBorder(const ComputedStyle& ) const; 41 const CollapsedBorderValue& cachedCollapsedBottomBorder(const ComputedStyle& ) const;
40 42
41 LayoutTableCell& m_layoutTableCell; 43 LayoutTableCell& m_layoutTableCell;
42 }; 44 };
43 45
44 } // namespace blink 46 } // namespace blink
45 47
46 #endif // TableCellPainter_h 48 #endif // TableCellPainter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698