OLD | NEW |
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/layout/style/CollapsedBorderValue.h" | 8 #include "core/layout/style/CollapsedBorderValue.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 struct PaintInfo; | 12 struct PaintInfo; |
13 class LayoutPoint; | 13 class LayoutPoint; |
14 class LayoutRect; | 14 class LayoutRect; |
15 class LayoutTableCell; | 15 class LayoutTableCell; |
16 class LayoutObject; | 16 class LayoutObject; |
17 class LayoutStyle; | 17 class ComputedStyle; |
18 | 18 |
19 class TableCellPainter { | 19 class TableCellPainter { |
20 public: | 20 public: |
21 TableCellPainter(LayoutTableCell& layoutTableCell) : m_layoutTableCell(layou
tTableCell) { } | 21 TableCellPainter(LayoutTableCell& layoutTableCell) : m_layoutTableCell(layou
tTableCell) { } |
22 | 22 |
23 void paint(const PaintInfo&, const LayoutPoint&); | 23 void paint(const PaintInfo&, const LayoutPoint&); |
24 | 24 |
25 void paintCollapsedBorders(const PaintInfo&, const LayoutPoint&); | 25 void paintCollapsedBorders(const PaintInfo&, const LayoutPoint&); |
26 void paintBackgroundsBehindCell(const PaintInfo&, const LayoutPoint&, Layout
Object* backgroundObject); | 26 void paintBackgroundsBehindCell(const PaintInfo&, const LayoutPoint&, Layout
Object* backgroundObject); |
27 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint& paint
Offset); | 27 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint& paint
Offset); |
28 void paintMask(const PaintInfo&, const LayoutPoint& paintOffset); | 28 void paintMask(const PaintInfo&, const LayoutPoint& paintOffset); |
29 | 29 |
30 enum PaintBoundOffsetBehavior { AddOffsetFromParent, DoNotAddOffsetFromParen
t }; | 30 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 | 31 // Returns the bonds of the table cell for painting, offset by paintOffset,
and if desired, the offset from the cell |
32 // to its parent. | 32 // to its parent. |
33 LayoutRect paintBounds(const LayoutPoint& paintOffset, PaintBoundOffsetBehav
ior); | 33 LayoutRect paintBounds(const LayoutPoint& paintOffset, PaintBoundOffsetBehav
ior); |
34 | 34 |
35 private: | 35 private: |
36 CollapsedBorderValue cachedCollapsedLeftBorder(const LayoutStyle&) const; | 36 CollapsedBorderValue cachedCollapsedLeftBorder(const ComputedStyle&) const; |
37 CollapsedBorderValue cachedCollapsedRightBorder(const LayoutStyle&) const; | 37 CollapsedBorderValue cachedCollapsedRightBorder(const ComputedStyle&) const; |
38 CollapsedBorderValue cachedCollapsedTopBorder(const LayoutStyle&) const; | 38 CollapsedBorderValue cachedCollapsedTopBorder(const ComputedStyle&) const; |
39 CollapsedBorderValue cachedCollapsedBottomBorder(const LayoutStyle&) const; | 39 CollapsedBorderValue cachedCollapsedBottomBorder(const ComputedStyle&) const
; |
40 | 40 |
41 LayoutTableCell& m_layoutTableCell; | 41 LayoutTableCell& m_layoutTableCell; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
45 | 45 |
46 #endif // TableCellPainter_h | 46 #endif // TableCellPainter_h |
OLD | NEW |