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 "config.h" | 5 #include "config.h" |
6 #include "core/paint/FrameSetPainter.h" | 6 #include "core/paint/FrameSetPainter.h" |
7 | 7 |
8 #include "core/html/HTMLFrameSetElement.h" | 8 #include "core/html/HTMLFrameSetElement.h" |
9 #include "core/layout/LayoutFrameSet.h" | 9 #include "core/layout/LayoutFrameSet.h" |
10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 static bool shouldPaintBorderAfter(const LayoutFrameSet::GridAxis& axis, size_t
index) | 65 static bool shouldPaintBorderAfter(const LayoutFrameSet::GridAxis& axis, size_t
index) |
66 { | 66 { |
67 // Should not paint a border after the last frame along the axis. | 67 // Should not paint a border after the last frame along the axis. |
68 return index + 1 < axis.m_sizes.size() && axis.m_allowBorder[index + 1]; | 68 return index + 1 < axis.m_sizes.size() && axis.m_allowBorder[index + 1]; |
69 } | 69 } |
70 | 70 |
71 void FrameSetPainter::paintBorders(const PaintInfo& paintInfo, const LayoutPoint
& adjustedPaintOffset) | 71 void FrameSetPainter::paintBorders(const PaintInfo& paintInfo, const LayoutPoint
& adjustedPaintOffset) |
72 { | 72 { |
73 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte
xt, m_layoutFrameSet, paintInfo.phase)) | 73 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(*paintInfo.conte
xt, m_layoutFrameSet, paintInfo.phase, adjustedPaintOffset)) |
74 return; | 74 return; |
75 | 75 |
76 LayoutRect adjustedFrameRect(adjustedPaintOffset, m_layoutFrameSet.size()); | 76 LayoutRect adjustedFrameRect(adjustedPaintOffset, m_layoutFrameSet.size()); |
77 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutFrameSet, p
aintInfo.phase, adjustedFrameRect); | 77 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutFrameSet, p
aintInfo.phase, adjustedFrameRect, adjustedPaintOffset); |
78 | 78 |
79 LayoutUnit borderThickness = m_layoutFrameSet.frameSet()->border(); | 79 LayoutUnit borderThickness = m_layoutFrameSet.frameSet()->border(); |
80 if (!borderThickness) | 80 if (!borderThickness) |
81 return; | 81 return; |
82 | 82 |
83 LayoutObject* child = m_layoutFrameSet.firstChild(); | 83 LayoutObject* child = m_layoutFrameSet.firstChild(); |
84 size_t rows = m_layoutFrameSet.rows().m_sizes.size(); | 84 size_t rows = m_layoutFrameSet.rows().m_sizes.size(); |
85 size_t cols = m_layoutFrameSet.columns().m_sizes.size(); | 85 size_t cols = m_layoutFrameSet.columns().m_sizes.size(); |
86 LayoutUnit yPos = 0; | 86 LayoutUnit yPos = 0; |
87 for (size_t r = 0; r < rows; r++) { | 87 for (size_t r = 0; r < rows; r++) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 LayoutObject* child = m_layoutFrameSet.firstChild(); | 134 LayoutObject* child = m_layoutFrameSet.firstChild(); |
135 if (!child) | 135 if (!child) |
136 return; | 136 return; |
137 | 137 |
138 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location(); | 138 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location(); |
139 paintChildren(paintInfo, adjustedPaintOffset); | 139 paintChildren(paintInfo, adjustedPaintOffset); |
140 paintBorders(paintInfo, adjustedPaintOffset); | 140 paintBorders(paintInfo, adjustedPaintOffset); |
141 } | 141 } |
142 | 142 |
143 } // namespace blink | 143 } // namespace blink |
OLD | NEW |