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

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

Issue 1315993004: Implement a paint offset cache for slimming paint v2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase more (world moved in the past hour) Created 5 years, 3 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
« no previous file with comments | « Source/core/paint/ListMarkerPainter.cpp ('k') | Source/core/paint/ObjectPainter.cpp » ('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/paint/BlockPainter.h" 9 #include "core/paint/BlockPainter.h"
10 #include "core/paint/BoxPainter.h" 10 #include "core/paint/BoxPainter.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_layoutMultiColumnSet.columnGap(); 45 LayoutUnit colGap = m_layoutMultiColumnSet.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_layoutMultiColumnSet.actualColumnCount(); 50 unsigned colCount = m_layoutMultiColumnSet.actualColumnCount();
51 if (colCount <= 1) 51 if (colCount <= 1)
52 return; 52 return;
53 53
54 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte xt, m_layoutMultiColumnSet, DisplayItem::ColumnRules)) 54 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte xt, m_layoutMultiColumnSet, DisplayItem::ColumnRules, paintOffset))
55 return; 55 return;
56 56
57 LayoutRect paintRect = m_layoutMultiColumnSet.visualOverflowRect(); 57 LayoutRect paintRect = m_layoutMultiColumnSet.visualOverflowRect();
58 paintRect.moveBy(paintOffset); 58 paintRect.moveBy(paintOffset);
59 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layoutMult iColumnSet, DisplayItem::ColumnRules, paintRect); 59 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layoutMult iColumnSet, DisplayItem::ColumnRules, paintRect, paintOffset);
60 60
61 bool antialias = BoxPainter::shouldAntialiasLines(paintInfo.context); 61 bool antialias = BoxPainter::shouldAntialiasLines(paintInfo.context);
62 bool leftToRight = m_layoutMultiColumnSet.style()->isLeftToRightDirection(); 62 bool leftToRight = m_layoutMultiColumnSet.style()->isLeftToRightDirection();
63 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_layoutMult iColumnSet.contentLogicalWidth(); 63 LayoutUnit currLogicalLeftOffset = leftToRight ? LayoutUnit() : m_layoutMult iColumnSet.contentLogicalWidth();
64 LayoutUnit ruleAdd = m_layoutMultiColumnSet.borderAndPaddingLogicalLeft(); 64 LayoutUnit ruleAdd = m_layoutMultiColumnSet.borderAndPaddingLogicalLeft();
65 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_layoutMultiColum nSet.contentLogicalWidth(); 65 LayoutUnit ruleLogicalLeft = leftToRight ? LayoutUnit() : m_layoutMultiColum nSet.contentLogicalWidth();
66 LayoutUnit inlineDirectionSize = m_layoutMultiColumnSet.pageLogicalWidth(); 66 LayoutUnit inlineDirectionSize = m_layoutMultiColumnSet.pageLogicalWidth();
67 BoxSide boxSide = m_layoutMultiColumnSet.isHorizontalWritingMode() 67 BoxSide boxSide = m_layoutMultiColumnSet.isHorizontalWritingMode()
68 ? leftToRight ? BSLeft : BSRight 68 ? leftToRight ? BSLeft : BSRight
69 : leftToRight ? BSTop : BSBottom; 69 : leftToRight ? BSTop : BSBottom;
(...skipping 16 matching lines...) Expand all
86 LayoutUnit ruleBottom = m_layoutMultiColumnSet.isHorizontalWritingMo de() ? ruleTop + m_layoutMultiColumnSet.contentHeight() : ruleTop + ruleThicknes s; 86 LayoutUnit ruleBottom = m_layoutMultiColumnSet.isHorizontalWritingMo de() ? ruleTop + m_layoutMultiColumnSet.contentHeight() : ruleTop + ruleThicknes s;
87 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft , ruleTop, ruleRight, ruleBottom); 87 IntRect pixelSnappedRuleRect = pixelSnappedIntRectFromEdges(ruleLeft , ruleTop, ruleRight, ruleBottom);
88 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias); 88 ObjectPainter::drawLineForBoxSide(paintInfo.context, pixelSnappedRul eRect.x(), pixelSnappedRuleRect.y(), pixelSnappedRuleRect.maxX(), pixelSnappedRu leRect.maxY(), boxSide, ruleColor, ruleStyle, 0, 0, antialias);
89 } 89 }
90 90
91 ruleLogicalLeft = currLogicalLeftOffset; 91 ruleLogicalLeft = currLogicalLeftOffset;
92 } 92 }
93 } 93 }
94 94
95 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/ListMarkerPainter.cpp ('k') | Source/core/paint/ObjectPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698