| 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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 LayoutUnit ruleThickness(blockStyle.columnRuleWidth()); | 43 LayoutUnit ruleThickness(blockStyle.columnRuleWidth()); |
| 44 LayoutUnit colGap = m_layoutMultiColumnSet.columnGap(); | 44 LayoutUnit colGap = m_layoutMultiColumnSet.columnGap(); |
| 45 bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent; | 45 bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent; |
| 46 if (!renderRule) | 46 if (!renderRule) |
| 47 return; | 47 return; |
| 48 | 48 |
| 49 unsigned colCount = m_layoutMultiColumnSet.actualColumnCount(); | 49 unsigned colCount = m_layoutMultiColumnSet.actualColumnCount(); |
| 50 if (colCount <= 1) | 50 if (colCount <= 1) |
| 51 return; | 51 return; |
| 52 | 52 |
| 53 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutMultiColumnSet, DisplayItem::ColumnRules, paintOffset)) | 53 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutMultiColumnSet, DisplayItem::ColumnRules)) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 LayoutRect paintRect = m_layoutMultiColumnSet.visualOverflowRect(); | 56 LayoutRect paintRect = m_layoutMultiColumnSet.visualOverflowRect(); |
| 57 paintRect.moveBy(paintOffset); | 57 paintRect.moveBy(paintOffset); |
| 58 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutMulti
ColumnSet, DisplayItem::ColumnRules, paintRect, paintOffset); | 58 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutMulti
ColumnSet, DisplayItem::ColumnRules, paintRect); |
| 59 | 59 |
| 60 bool leftToRight = m_layoutMultiColumnSet.style()->isLeftToRightDirection(); | 60 bool leftToRight = m_layoutMultiColumnSet.style()->isLeftToRightDirection(); |
| 61 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_layoutMult
iColumnSet.contentLogicalWidth(); | 61 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_layoutMult
iColumnSet.contentLogicalWidth(); |
| 62 LayoutUnit ruleAdd = m_layoutMultiColumnSet.borderAndPaddingLogicalLeft(); | 62 LayoutUnit ruleAdd = m_layoutMultiColumnSet.borderAndPaddingLogicalLeft(); |
| 63 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_layoutMultiColum
nSet.contentLogicalWidth(); | 63 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_layoutMultiColum
nSet.contentLogicalWidth(); |
| 64 LayoutUnit inlineDirectionSize = m_layoutMultiColumnSet.pageLogicalWidth(); | 64 LayoutUnit inlineDirectionSize = m_layoutMultiColumnSet.pageLogicalWidth(); |
| 65 BoxSide boxSide = m_layoutMultiColumnSet.isHorizontalWritingMode() | 65 BoxSide boxSide = m_layoutMultiColumnSet.isHorizontalWritingMode() |
| 66 ? leftToRight ? BSLeft : BSRight | 66 ? leftToRight ? BSLeft : BSRight |
| 67 : leftToRight ? BSTop : BSBottom; | 67 : leftToRight ? BSTop : BSBottom; |
| 68 | 68 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 84 LayoutUnit ruleBottom = m_layoutMultiColumnSet.isHorizontalWritingMo
de() ? ruleTop + m_layoutMultiColumnSet.contentHeight() : ruleTop + ruleThicknes
s; | 84 LayoutUnit ruleBottom = m_layoutMultiColumnSet.isHorizontalWritingMo
de() ? ruleTop + m_layoutMultiColumnSet.contentHeight() : ruleTop + ruleThicknes
s; |
| 85 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft
, ruleTop, ruleRight, ruleBottom); | 85 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft
, ruleTop, ruleRight, ruleBottom); |
| 86 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul
eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu
leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, true); | 86 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul
eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu
leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, true); |
| 87 } | 87 } |
| 88 | 88 |
| 89 ruleLogicalLeft = currLogicalLeftOffset; | 89 ruleLogicalLeft = currLogicalLeftOffset; |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| OLD | NEW |