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

Side by Side Diff: third_party/WebKit/Source/core/paint/FrameSetPainter.cpp

Issue 1653673002: Even more explicit LayoutUnit conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moarConstructors
Patch Set: address comments Created 4 years, 10 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 "core/paint/FrameSetPainter.h" 5 #include "core/paint/FrameSetPainter.h"
6 6
7 #include "core/html/HTMLFrameSetElement.h" 7 #include "core/html/HTMLFrameSetElement.h"
8 #include "core/layout/LayoutFrameSet.h" 8 #include "core/layout/LayoutFrameSet.h"
9 #include "core/paint/LayoutObjectDrawingRecorder.h" 9 #include "core/paint/LayoutObjectDrawingRecorder.h"
10 #include "core/paint/PaintInfo.h" 10 #include "core/paint/PaintInfo.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 LayoutRect adjustedFrameRect(adjustedPaintOffset, m_layoutFrameSet.size()); 75 LayoutRect adjustedFrameRect(adjustedPaintOffset, m_layoutFrameSet.size());
76 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutFrameSet, pa intInfo.phase, adjustedFrameRect, adjustedPaintOffset); 76 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutFrameSet, pa intInfo.phase, adjustedFrameRect, adjustedPaintOffset);
77 77
78 LayoutUnit borderThickness = m_layoutFrameSet.frameSet()->border(); 78 LayoutUnit borderThickness = m_layoutFrameSet.frameSet()->border();
79 if (!borderThickness) 79 if (!borderThickness)
80 return; 80 return;
81 81
82 LayoutObject* child = m_layoutFrameSet.firstChild(); 82 LayoutObject* child = m_layoutFrameSet.firstChild();
83 size_t rows = m_layoutFrameSet.rows().m_sizes.size(); 83 size_t rows = m_layoutFrameSet.rows().m_sizes.size();
84 size_t cols = m_layoutFrameSet.columns().m_sizes.size(); 84 size_t cols = m_layoutFrameSet.columns().m_sizes.size();
85 LayoutUnit yPos = 0; 85 LayoutUnit yPos;
86 for (size_t r = 0; r < rows; r++) { 86 for (size_t r = 0; r < rows; r++) {
87 LayoutUnit xPos = 0; 87 LayoutUnit xPos;
88 for (size_t c = 0; c < cols; c++) { 88 for (size_t c = 0; c < cols; c++) {
89 xPos += m_layoutFrameSet.columns().m_sizes[c]; 89 xPos += m_layoutFrameSet.columns().m_sizes[c];
90 if (shouldPaintBorderAfter(m_layoutFrameSet.columns(), c)) { 90 if (shouldPaintBorderAfter(m_layoutFrameSet.columns(), c)) {
91 paintColumnBorder(paintInfo, pixelSnappedIntRect( 91 paintColumnBorder(paintInfo, pixelSnappedIntRect(
92 LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffs et.y() + yPos, borderThickness, m_layoutFrameSet.size().height() - yPos))); 92 LayoutRect(adjustedPaintOffset.x() + xPos, adjustedPaintOffs et.y() + yPos, borderThickness, m_layoutFrameSet.size().height() - yPos)));
93 xPos += borderThickness; 93 xPos += borderThickness;
94 } 94 }
95 child = child->nextSibling(); 95 child = child->nextSibling();
96 if (!child) 96 if (!child)
97 return; 97 return;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 LayoutObject* child = m_layoutFrameSet.firstChild(); 133 LayoutObject* child = m_layoutFrameSet.firstChild();
134 if (!child) 134 if (!child)
135 return; 135 return;
136 136
137 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location(); 137 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location();
138 paintChildren(paintInfo, adjustedPaintOffset); 138 paintChildren(paintInfo, adjustedPaintOffset);
139 paintBorders(paintInfo, adjustedPaintOffset); 139 paintBorders(paintInfo, adjustedPaintOffset);
140 } 140 }
141 141
142 } // namespace blink 142 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698