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