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

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

Issue 834653003: [Slimming paint] [New Multicolumn] Repaint column rules when they change. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make the test useful. Created 5 years, 11 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
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/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/RenderDrawingRecorder.h" 10 #include "core/paint/RenderDrawingRecorder.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 DrawingRecorder drawingRecorder(paintInfo.context, m_renderMultiColumnSet.di splayItemClient(), DisplayItem::ColumnRules, m_renderMultiColumnSet.visualOverfl owRect()); 54 DrawingRecorder drawingRecorder(paintInfo.context, m_renderMultiColumnSet.di splayItemClient(), DisplayItem::ColumnRules, m_renderMultiColumnSet.visualOverfl owRect());
55 if (drawingRecorder.canUseCachedDrawing())
56 return;
57
55 bool antialias = BoxPainter::shouldAntialiasLines(paintInfo.context); 58 bool antialias = BoxPainter::shouldAntialiasLines(paintInfo.context);
56 bool leftToRight = m_renderMultiColumnSet.style()->isLeftToRightDirection(); 59 bool leftToRight = m_renderMultiColumnSet.style()->isLeftToRightDirection();
57 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_renderMult iColumnSet.contentLogicalWidth(); 60 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_renderMult iColumnSet.contentLogicalWidth();
58 LayoutUnit ruleAdd = m_renderMultiColumnSet.borderAndPaddingLogicalLeft(); 61 LayoutUnit ruleAdd = m_renderMultiColumnSet.borderAndPaddingLogicalLeft();
59 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_renderMultiColum nSet.contentLogicalWidth(); 62 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_renderMultiColum nSet.contentLogicalWidth();
60 LayoutUnit inlineDirectionSize = m_renderMultiColumnSet.pageLogicalWidth(); 63 LayoutUnit inlineDirectionSize = m_renderMultiColumnSet.pageLogicalWidth();
61 BoxSide boxSide = m_renderMultiColumnSet.isHorizontalWritingMode() 64 BoxSide boxSide = m_renderMultiColumnSet.isHorizontalWritingMode()
62 ? leftToRight ? BSLeft : BSRight 65 ? leftToRight ? BSLeft : BSRight
63 : leftToRight ? BSTop : BSBottom; 66 : leftToRight ? BSTop : BSBottom;
64 67
(...skipping 15 matching lines...) Expand all
80 LayoutUnit ruleBottom = m_renderMultiColumnSet.isHorizontalWritingMo de() ? ruleTop + m_renderMultiColumnSet.contentHeight() : ruleTop + ruleThicknes s; 83 LayoutUnit ruleBottom = m_renderMultiColumnSet.isHorizontalWritingMo de() ? ruleTop + m_renderMultiColumnSet.contentHeight() : ruleTop + ruleThicknes s;
81 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft , ruleTop, ruleRight, ruleBottom); 84 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft , ruleTop, ruleRight, ruleBottom);
82 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias); 85 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias);
83 } 86 }
84 87
85 ruleLogicalLeft = currLogicalLeftOffset; 88 ruleLogicalLeft = currLogicalLeftOffset;
86 } 89 }
87 } 90 }
88 91
89 } // namespace blink 92 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/change-column-rule-expected.html ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698