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

Side by Side Diff: Source/core/paint/MultiColumnSetPainter.cpp

Issue 963873002: [Slimming Paint] Adjust the paint rect for paintOffset when painting column rules. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/paint/RenderDrawingRecorder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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/layout/PaintInfo.h" 9 #include "core/layout/PaintInfo.h"
10 #include "core/paint/BlockPainter.h" 10 #include "core/paint/BlockPainter.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 LayoutUnit ruleThickness = blockStyle.columnRuleWidth(); 44 LayoutUnit ruleThickness = blockStyle.columnRuleWidth();
45 LayoutUnit colGap = m_renderMultiColumnSet.columnGap(); 45 LayoutUnit colGap = m_renderMultiColumnSet.columnGap();
46 bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent; 46 bool renderRule = ruleStyle > BHIDDEN && !ruleTransparent;
47 if (!renderRule) 47 if (!renderRule)
48 return; 48 return;
49 49
50 unsigned colCount = m_renderMultiColumnSet.actualColumnCount(); 50 unsigned colCount = m_renderMultiColumnSet.actualColumnCount();
51 if (colCount <= 1) 51 if (colCount <= 1)
52 return; 52 return;
53 53
54 RenderDrawingRecorder drawingRecorder(paintInfo.context, m_renderMultiColumn Set, DisplayItem::ColumnRules, m_renderMultiColumnSet.visualOverflowRect()); 54 LayoutRect paintRect = m_renderMultiColumnSet.visualOverflowRect();
55 paintRect.moveBy(paintOffset);
56 RenderDrawingRecorder drawingRecorder(paintInfo.context, m_renderMultiColumn Set, DisplayItem::ColumnRules, paintRect);
55 if (drawingRecorder.canUseCachedDrawing()) 57 if (drawingRecorder.canUseCachedDrawing())
56 return; 58 return;
57 59
58 bool antialias = BoxPainter::shouldAntialiasLines(paintInfo.context); 60 bool antialias = BoxPainter::shouldAntialiasLines(paintInfo.context);
59 bool leftToRight = m_renderMultiColumnSet.style()->isLeftToRightDirection(); 61 bool leftToRight = m_renderMultiColumnSet.style()->isLeftToRightDirection();
60 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_renderMult iColumnSet.contentLogicalWidth(); 62 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_renderMult iColumnSet.contentLogicalWidth();
61 LayoutUnit ruleAdd = m_renderMultiColumnSet.borderAndPaddingLogicalLeft(); 63 LayoutUnit ruleAdd = m_renderMultiColumnSet.borderAndPaddingLogicalLeft();
62 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_renderMultiColum nSet.contentLogicalWidth(); 64 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_renderMultiColum nSet.contentLogicalWidth();
63 LayoutUnit inlineDirectionSize = m_renderMultiColumnSet.pageLogicalWidth(); 65 LayoutUnit inlineDirectionSize = m_renderMultiColumnSet.pageLogicalWidth();
64 BoxSide boxSide = m_renderMultiColumnSet.isHorizontalWritingMode() 66 BoxSide boxSide = m_renderMultiColumnSet.isHorizontalWritingMode()
(...skipping 18 matching lines...) Expand all
83 LayoutUnit ruleBottom = m_renderMultiColumnSet.isHorizontalWritingMo de() ? ruleTop + m_renderMultiColumnSet.contentHeight() : ruleTop + ruleThicknes s; 85 LayoutUnit ruleBottom = m_renderMultiColumnSet.isHorizontalWritingMo de() ? ruleTop + m_renderMultiColumnSet.contentHeight() : ruleTop + ruleThicknes s;
84 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft , ruleTop, ruleRight, ruleBottom); 86 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft , ruleTop, ruleRight, ruleBottom);
85 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);
86 } 88 }
87 89
88 ruleLogicalLeft = currLogicalLeftOffset; 90 ruleLogicalLeft = currLogicalLeftOffset;
89 } 91 }
90 } 92 }
91 93
92 } // namespace blink 94 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/paint/RenderDrawingRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698