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

Side by Side Diff: third_party/WebKit/Source/core/paint/TableSectionPainter.h

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

Powered by Google App Engine
This is Rietveld 408576698