| 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 "core/paint/MultiColumnSetPainter.h" | 5 #include "core/paint/MultiColumnSetPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutMultiColumnSet.h" | 7 #include "core/layout/LayoutMultiColumnSet.h" |
| 8 #include "core/paint/BlockPainter.h" | 8 #include "core/paint/BlockPainter.h" |
| 9 #include "core/paint/BoxPainter.h" | 9 #include "core/paint/BoxPainter.h" |
| 10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 11 #include "core/paint/ObjectPainter.h" | 11 #include "core/paint/ObjectPainter.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, | 17 void MultiColumnSetPainter::paintObject(const PaintInfo& paintInfo, |
| 18 const LayoutPoint& paintOffset) { | 18 const LayoutPoint& paintOffset) { |
| 19 if (m_layoutMultiColumnSet.style()->visibility() != EVisibility::Visible) | 19 if (m_layoutMultiColumnSet.style()->visibility() != EVisibility::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/fo
reground overlap etc., just like | 25 // Columns should technically respect phases and allow for |
| 26 // LayoutBlocks do. Note this is a pretty minor issue, since the old column im
plementation clipped columns | 26 // background/float/foreground overlap etc., just like LayoutBlocks do. Note |
| 27 // anyway, thus making it impossible for them to overlap one another. It's als
o really unlikely that the columns | 27 // this is a pretty minor issue, since the old column implementation clipped |
| 28 // would overlap another block. | 28 // columns anyway, thus making it impossible for them to overlap one another. |
| 29 // It's also really unlikely that the columns would overlap another block. |
| 29 if (!m_layoutMultiColumnSet.flowThread() || | 30 if (!m_layoutMultiColumnSet.flowThread() || |
| 30 (paintInfo.phase != PaintPhaseForeground && | 31 (paintInfo.phase != PaintPhaseForeground && |
| 31 paintInfo.phase != PaintPhaseSelection)) | 32 paintInfo.phase != PaintPhaseSelection)) |
| 32 return; | 33 return; |
| 33 | 34 |
| 34 paintColumnRules(paintInfo, paintOffset); | 35 paintColumnRules(paintInfo, paintOffset); |
| 35 } | 36 } |
| 36 | 37 |
| 37 void MultiColumnSetPainter::paintColumnRules(const PaintInfo& paintInfo, | 38 void MultiColumnSetPainter::paintColumnRules(const PaintInfo& paintInfo, |
| 38 const LayoutPoint& paintOffset) { | 39 const LayoutPoint& paintOffset) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 64 for (auto& bound : columnRuleBounds) { | 65 for (auto& bound : columnRuleBounds) { |
| 65 IntRect pixelSnappedRuleRect = pixelSnappedIntRect(bound); | 66 IntRect pixelSnappedRuleRect = pixelSnappedIntRect(bound); |
| 66 ObjectPainter::drawLineForBoxSide( | 67 ObjectPainter::drawLineForBoxSide( |
| 67 paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), | 68 paintInfo.context, pixelSnappedRuleRect.x(), pixelSnappedRuleRect.y(), |
| 68 pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, | 69 pixelSnappedRuleRect.maxX(), pixelSnappedRuleRect.maxY(), boxSide, |
| 69 ruleColor, ruleStyle, 0, 0, true); | 70 ruleColor, ruleStyle, 0, 0, true); |
| 70 } | 71 } |
| 71 } | 72 } |
| 72 | 73 |
| 73 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |