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/MultiColumnSetPainter.h" | 6 #include "core/paint/MultiColumnSetPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutMultiColumnSet.h" | 8 #include "core/layout/LayoutMultiColumnSet.h" |
9 #include "core/paint/BlockPainter.h" | 9 #include "core/paint/BlockPainter.h" |
10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
11 #include "core/paint/LayoutObjectDrawingRecorder.h" | 11 #include "core/paint/LayoutObjectDrawingRecorder.h" |
12 #include "core/paint/PaintInfo.h" | 12 #include "core/paint/PaintInfo.h" |
13 #include "platform/geometry/LayoutPoint.h" | 13 #include "platform/geometry/LayoutPoint.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 void MultiColumnSetPainter::paintObject(const PaintInfo& paintInfo, const Layout
Point& paintOffset) | 17 void MultiColumnSetPainter::paintObject(const PaintInfo& paintInfo, const Layout
Point& paintOffset) |
18 { | 18 { |
19 if (m_layoutMultiColumnSet.style()->visibility() != VISIBLE) | 19 if (m_layoutMultiColumnSet.style()->visibility() != VISIBLE) |
20 return; | 20 return; |
21 | 21 |
22 BlockPainter(m_layoutMultiColumnSet).paintObject(paintInfo, paintOffset); | 22 BlockPainter(m_layoutMultiColumnSet).paintObject(paintInfo, paintOffset); |
23 | 23 |
24 // FIXME: Right now we're only painting in the foreground phase. | 24 // FIXME: Right now we're only painting in the foreground phase. |
25 // Columns should technically respect phases and allow for background/float/
foreground overlap etc., just like | 25 // Columns should technically respect phases and allow for background/float/
foreground overlap etc., just like |
26 // LayoutBlocks do. Note this is a pretty minor issue, since the old column
implementation clipped columns | 26 // LayoutBlocks do. Note this is a pretty minor issue, since the old column
implementation clipped columns |
27 // anyway, thus making it impossible for them to overlap one another. It's a
lso really unlikely that the columns | 27 // anyway, thus making it impossible for them to overlap one another. It's a
lso really unlikely that the columns |
28 // would overlap another block. | 28 // would overlap another block. |
29 if (!m_layoutMultiColumnSet.flowThread() || !m_layoutMultiColumnSet.isValid(
) || (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSe
lection)) | 29 if (!m_layoutMultiColumnSet.flowThread() || (paintInfo.phase != PaintPhaseFo
reground && paintInfo.phase != PaintPhaseSelection)) |
30 return; | 30 return; |
31 | 31 |
32 paintColumnRules(paintInfo, paintOffset); | 32 paintColumnRules(paintInfo, paintOffset); |
33 } | 33 } |
34 | 34 |
35 void MultiColumnSetPainter::paintColumnRules(const PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) | 35 void MultiColumnSetPainter::paintColumnRules(const PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) |
36 { | 36 { |
37 if (m_layoutMultiColumnSet.flowThread()->isLayoutPagedFlowThread()) | 37 if (m_layoutMultiColumnSet.flowThread()->isLayoutPagedFlowThread()) |
38 return; | 38 return; |
39 | 39 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 LayoutUnit ruleBottom = m_layoutMultiColumnSet.isHorizontalWritingMo
de() ? ruleTop + m_layoutMultiColumnSet.contentHeight() : ruleTop + ruleThicknes
s; | 85 LayoutUnit ruleBottom = m_layoutMultiColumnSet.isHorizontalWritingMo
de() ? ruleTop + m_layoutMultiColumnSet.contentHeight() : ruleTop + ruleThicknes
s; |
86 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft
, ruleTop, ruleRight, ruleBottom); | 86 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft
, ruleTop, ruleRight, ruleBottom); |
87 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul
eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu
leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias); | 87 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul
eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu
leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias); |
88 } | 88 } |
89 | 89 |
90 ruleLogicalLeft = currLogicalLeftOffset; | 90 ruleLogicalLeft = currLogicalLeftOffset; |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 } // namespace blink | 94 } // namespace blink |
OLD | NEW |