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

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

Issue 1781463002: Fix table background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sample code for improved collapsed border painting Created 3 years, 11 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 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 LayoutBox;
16 class LayoutPoint; 17 class LayoutPoint;
17 class LayoutRect; 18 class LayoutRect;
18 class LayoutTableCell; 19 class LayoutTableCell;
19 class LayoutObject; 20 class LayoutObject;
20 class ComputedStyle; 21 class ComputedStyle;
21 22
22 class TableCellPainter { 23 class TableCellPainter {
23 STACK_ALLOCATED(); 24 STACK_ALLOCATED();
24 public: 25 public:
25 TableCellPainter(const LayoutTableCell& layoutTableCell) : m_layoutTableCell (layoutTableCell) { } 26 TableCellPainter(const LayoutTableCell& layoutTableCell) : m_layoutTableCell (layoutTableCell) { }
26 27
27 void paint(const PaintInfo&, const LayoutPoint&); 28 void paint(const PaintInfo&, const LayoutPoint&);
28 29
29 void paintCollapsedBorders(const PaintInfo&, const LayoutPoint&, const Colla psedBorderValue&); 30 void paintCollapsedBorders(const PaintInfo&, const LayoutPoint&, const Colla psedBorderValue&);
30 void paintBackgroundsBehindCell(const PaintInfo&, const LayoutPoint&, const LayoutObject* backgroundObject, DisplayItem::Type); 31 void paintBackgroundsBehindCell(const PaintInfo&, const LayoutPoint&, const LayoutBox* backgroundObject, DisplayItem::Type);
31 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint& paint Offset); 32 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint& paint Offset);
32 void paintMask(const PaintInfo&, const LayoutPoint& paintOffset); 33 void paintMask(const PaintInfo&, const LayoutPoint& paintOffset);
33 34
34 enum PaintBoundOffsetBehavior { AddOffsetFromParent, DoNotAddOffsetFromParen t }; 35 enum PaintBoundOffsetBehavior { AddOffsetFromParent, DoNotAddOffsetFromParen t };
35 // Returns the bonds of the table cell for painting, offset by paintOffset, and if desired, the offset from the cell 36 // Returns the bonds of the table cell for painting, offset by paintOffset, and if desired, the offset from the cell
36 // to its parent. 37 // to its parent.
37 LayoutRect paintBounds(const LayoutPoint& paintOffset, PaintBoundOffsetBehav ior); 38 LayoutRect paintBounds(const LayoutPoint& paintOffset, PaintBoundOffsetBehav ior);
38 39
40 void paintParentBackgroundsBehindCell(const PaintInfo&, const LayoutPoint&, const LayoutBox* backgroundObject, DisplayItem::Type);
41
42 // Computed bounds for parent background objects.
43 LayoutRect paintBoundsParent(const LayoutPoint& paintOffset, const LayoutBox *, DisplayItem::Type);
44
39 private: 45 private:
40 const CollapsedBorderValue* cachedCollapsedLeftBorder(const ComputedStyle&) const; 46 const CollapsedBorderValue* cachedCollapsedLeftBorder(const ComputedStyle&) const;
41 const CollapsedBorderValue* cachedCollapsedRightBorder(const ComputedStyle&) const; 47 const CollapsedBorderValue* cachedCollapsedRightBorder(const ComputedStyle&) const;
42 const CollapsedBorderValue* cachedCollapsedTopBorder(const ComputedStyle&) c onst; 48 const CollapsedBorderValue* cachedCollapsedTopBorder(const ComputedStyle&) c onst;
43 const CollapsedBorderValue* cachedCollapsedBottomBorder(const ComputedStyle& ) const; 49 const CollapsedBorderValue* cachedCollapsedBottomBorder(const ComputedStyle& ) const;
44 50
45 const LayoutTableCell& m_layoutTableCell; 51 const LayoutTableCell& m_layoutTableCell;
46 }; 52 };
47 53
48 } // namespace blink 54 } // namespace blink
49 55
50 #endif // TableCellPainter_h 56 #endif // TableCellPainter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698