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