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 #include "config.h" | 5 #include "config.h" |
6 #include "core/paint/TablePainter.h" | 6 #include "core/paint/TablePainter.h" |
7 | 7 |
8 #include "core/layout/LayoutTable.h" | 8 #include "core/layout/LayoutTable.h" |
9 #include "core/layout/LayoutTableSection.h" | 9 #include "core/layout/LayoutTableSection.h" |
10 #include "core/style/CollapsedBorderValue.h" | 10 #include "core/style/CollapsedBorderValue.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 m_layoutTable.setCurrentBorderValue(&collapsedBorders[i]); | 58 m_layoutTable.setCurrentBorderValue(&collapsedBorders[i]); |
59 for (LayoutTableSection* section = m_layoutTable.bottomSection(); se
ction; section = m_layoutTable.sectionAbove(section)) { | 59 for (LayoutTableSection* section = m_layoutTable.bottomSection(); se
ction; section = m_layoutTable.sectionAbove(section)) { |
60 LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChil
d(section, paintOffset); | 60 LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChil
d(section, paintOffset); |
61 section->paint(info, childPoint); | 61 section->paint(info, childPoint); |
62 } | 62 } |
63 } | 63 } |
64 m_layoutTable.setCurrentBorderValue(0); | 64 m_layoutTable.setCurrentBorderValue(0); |
65 } | 65 } |
66 | 66 |
67 // Paint outline. | 67 // Paint outline. |
68 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline)
&& m_layoutTable.style()->hasOutline() && m_layoutTable.style()->visibility() =
= VISIBLE) { | 68 if ((paintPhase == PaintPhaseOutline || paintPhase == PaintPhaseSelfOutline)
&& m_layoutTable.style()->hasOutline() && m_layoutTable.style()->visibility() =
= VISIBLE) |
69 LayoutRect overflowRect(m_layoutTable.visualOverflowRect()); | 69 ObjectPainter(m_layoutTable).paintOutline(paintInfo, m_layoutTable.visua
lOverflowRect(), m_layoutTable.size(), paintOffset); |
70 overflowRect.moveBy(paintOffset); | |
71 ObjectPainter(m_layoutTable).paintOutline(paintInfo, LayoutRect(paintOff
set, m_layoutTable.size()), overflowRect); | |
72 } | |
73 } | 70 } |
74 | 71 |
75 void TablePainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, cons
t LayoutPoint& paintOffset) | 72 void TablePainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, cons
t LayoutPoint& paintOffset) |
76 { | 73 { |
77 if (!paintInfo.shouldPaintWithinRoot(&m_layoutTable)) | 74 if (!paintInfo.shouldPaintWithinRoot(&m_layoutTable)) |
78 return; | 75 return; |
79 | 76 |
80 LayoutRect rect(paintOffset, m_layoutTable.size()); | 77 LayoutRect rect(paintOffset, m_layoutTable.size()); |
81 m_layoutTable.subtractCaptionRect(rect); | 78 m_layoutTable.subtractCaptionRect(rect); |
82 BoxPainter(m_layoutTable).paintBoxDecorationBackgroundWithRect(paintInfo, pa
intOffset, rect); | 79 BoxPainter(m_layoutTable).paintBoxDecorationBackgroundWithRect(paintInfo, pa
intOffset, rect); |
83 } | 80 } |
84 | 81 |
85 void TablePainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& pain
tOffset) | 82 void TablePainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& pain
tOffset) |
86 { | 83 { |
87 if (m_layoutTable.style()->visibility() != VISIBLE || paintInfo.phase != Pai
ntPhaseMask) | 84 if (m_layoutTable.style()->visibility() != VISIBLE || paintInfo.phase != Pai
ntPhaseMask) |
88 return; | 85 return; |
89 | 86 |
90 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte
xt, m_layoutTable, paintInfo.phase)) | 87 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte
xt, m_layoutTable, paintInfo.phase)) |
91 return; | 88 return; |
92 | 89 |
93 LayoutRect rect(paintOffset, m_layoutTable.size()); | 90 LayoutRect rect(paintOffset, m_layoutTable.size()); |
94 m_layoutTable.subtractCaptionRect(rect); | 91 m_layoutTable.subtractCaptionRect(rect); |
95 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTable, pain
tInfo.phase, pixelSnappedIntRect(rect)); | 92 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutTable, pain
tInfo.phase, pixelSnappedIntRect(rect)); |
96 BoxPainter(m_layoutTable).paintMaskImages(paintInfo, rect); | 93 BoxPainter(m_layoutTable).paintMaskImages(paintInfo, rect); |
97 } | 94 } |
98 | 95 |
99 } // namespace blink | 96 } // namespace blink |
OLD | NEW |