| 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 TableSectionPainter_h | 5 #ifndef TableSectionPainter_h |
| 6 #define TableSectionPainter_h | 6 #define TableSectionPainter_h |
| 7 | 7 |
| 8 #include "core/paint/PaintPhase.h" | 8 #include "core/paint/PaintPhase.h" |
| 9 #include "core/paint/PaintResult.h" | |
| 10 #include "core/style/ShadowData.h" | 9 #include "core/style/ShadowData.h" |
| 11 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| 12 | 11 |
| 13 namespace blink { | 12 namespace blink { |
| 14 | 13 |
| 15 class CellSpan; | 14 class CellSpan; |
| 16 class CollapsedBorderValue; | 15 class CollapsedBorderValue; |
| 17 class LayoutPoint; | 16 class LayoutPoint; |
| 18 class LayoutTableCell; | 17 class LayoutTableCell; |
| 19 class LayoutTableSection; | 18 class LayoutTableSection; |
| 20 struct PaintInfo; | 19 struct PaintInfo; |
| 21 | 20 |
| 22 class TableSectionPainter { | 21 class TableSectionPainter { |
| 23 STACK_ALLOCATED(); | 22 STACK_ALLOCATED(); |
| 24 | 23 |
| 25 public: | 24 public: |
| 26 TableSectionPainter(const LayoutTableSection& layoutTableSection) | 25 TableSectionPainter(const LayoutTableSection& layoutTableSection) |
| 27 : m_layoutTableSection(layoutTableSection) {} | 26 : m_layoutTableSection(layoutTableSection) {} |
| 28 | 27 |
| 29 void paint(const PaintInfo&, const LayoutPoint&); | 28 void paint(const PaintInfo&, const LayoutPoint&); |
| 30 | 29 void paintCollapsedBorders(const PaintInfo&, |
| 31 PaintResult paintCollapsedBorders(const PaintInfo&, | 30 const LayoutPoint&, |
| 32 const LayoutPoint&, | 31 const CollapsedBorderValue&); |
| 33 const CollapsedBorderValue&); | |
| 34 | 32 |
| 35 private: | 33 private: |
| 36 void paintObject(const PaintInfo&, const LayoutPoint&); | 34 void paintObject(const PaintInfo&, const LayoutPoint&); |
| 37 | 35 |
| 38 void paintBackgroundsBehindCell(const LayoutTableCell&, | 36 void paintBackgroundsBehindCell(const LayoutTableCell&, |
| 39 const PaintInfo&, | 37 const PaintInfo&, |
| 40 const LayoutPoint&); | 38 const LayoutPoint&); |
| 41 void paintCell(const LayoutTableCell&, const PaintInfo&, const LayoutPoint&); | 39 void paintCell(const LayoutTableCell&, const PaintInfo&, const LayoutPoint&); |
| 42 void paintBoxShadow(const PaintInfo&, const LayoutPoint&, ShadowStyle); | 40 void paintBoxShadow(const PaintInfo&, const LayoutPoint&, ShadowStyle); |
| 43 | 41 |
| 44 // Returns the primary cell that should be painted for the grid item at (row, | 42 // Returns the primary cell that should be painted for the grid item at (row, |
| 45 // column) intersecting dirtiedRows and dirtiedColumns. Returns nullptr if we | 43 // column) intersecting dirtiedRows and dirtiedColumns. Returns nullptr if we |
| 46 // have painted the grid item when painting the grid item left to or above | 44 // have painted the grid item when painting the grid item left to or above |
| 47 // (row, column) when painting cells intersecting dirtiedRows and | 45 // (row, column) when painting cells intersecting dirtiedRows and |
| 48 // dirtiedColumns. | 46 // dirtiedColumns. |
| 49 const LayoutTableCell* primaryCellToPaint( | 47 const LayoutTableCell* primaryCellToPaint( |
| 50 unsigned row, | 48 unsigned row, |
| 51 unsigned column, | 49 unsigned column, |
| 52 const CellSpan& dirtiedRows, | 50 const CellSpan& dirtiedRows, |
| 53 const CellSpan& dirtiedColumns) const; | 51 const CellSpan& dirtiedColumns) const; |
| 54 | 52 |
| 55 enum ItemToPaint { PaintCollapsedBorders, PaintSection }; | 53 enum ItemToPaint { PaintCollapsedBorders, PaintSection }; |
| 56 void paintRepeatingHeaderGroup(const PaintInfo&, | 54 void paintRepeatingHeaderGroup(const PaintInfo&, |
| 57 const LayoutPoint& paintOffset, | 55 const LayoutPoint& paintOffset, |
| 58 const CollapsedBorderValue& currentBorderValue, | 56 const CollapsedBorderValue& currentBorderValue, |
| 59 ItemToPaint); | 57 ItemToPaint); |
| 60 void paintSection(const PaintInfo&, const LayoutPoint&); | 58 void paintSection(const PaintInfo&, const LayoutPoint&); |
| 61 PaintResult paintCollapsedSectionBorders(const PaintInfo&, | 59 void paintCollapsedSectionBorders(const PaintInfo&, |
| 62 const LayoutPoint&, | 60 const LayoutPoint&, |
| 63 const CollapsedBorderValue&); | 61 const CollapsedBorderValue&); |
| 64 | 62 |
| 65 const LayoutTableSection& m_layoutTableSection; | 63 const LayoutTableSection& m_layoutTableSection; |
| 66 }; | 64 }; |
| 67 | 65 |
| 68 } // namespace blink | 66 } // namespace blink |
| 69 | 67 |
| 70 #endif // TableSectionPainter_h | 68 #endif // TableSectionPainter_h |
| OLD | NEW |