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 "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/ObjectPainter.h" | 10 #include "core/paint/ObjectPainter.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 void FrameSetPainter::paintColumnBorder(const PaintInfo& paintInfo, | 27 void FrameSetPainter::paintColumnBorder(const PaintInfo& paintInfo, |
28 const IntRect& borderRect) { | 28 const IntRect& borderRect) { |
29 if (!paintInfo.cullRect().intersectsCullRect(borderRect)) | 29 if (!paintInfo.cullRect().intersectsCullRect(borderRect)) |
30 return; | 30 return; |
31 | 31 |
32 // FIXME: We should do something clever when borders from distinct framesets | 32 // FIXME: We should do something clever when borders from distinct framesets |
33 // meet at a join. | 33 // meet at a join. |
34 | 34 |
35 // Fill first. | 35 // Fill first. |
36 GraphicsContext& context = paintInfo.context; | 36 GraphicsContext& context = paintInfo.context; |
37 context.fillRect(borderRect, m_layoutFrameSet.frameSet()->hasBorderColor() | 37 context.fillRect( |
38 ? m_layoutFrameSet.resolveColor( | 38 borderRect, |
39 CSSPropertyBorderLeftColor) | 39 m_layoutFrameSet.frameSet()->hasBorderColor() |
40 : borderFillColor()); | 40 ? m_layoutFrameSet.resolveColor(CSSPropertyBorderLeftColor) |
| 41 : borderFillColor()); |
41 | 42 |
42 // Now stroke the edges but only if we have enough room to paint both edges | 43 // Now stroke the edges but only if we have enough room to paint both edges |
43 // with a little bit of the fill color showing through. | 44 // with a little bit of the fill color showing through. |
44 if (borderRect.width() >= 3) { | 45 if (borderRect.width() >= 3) { |
45 context.fillRect( | 46 context.fillRect( |
46 IntRect(borderRect.location(), IntSize(1, borderRect.height())), | 47 IntRect(borderRect.location(), IntSize(1, borderRect.height())), |
47 borderStartEdgeColor()); | 48 borderStartEdgeColor()); |
48 context.fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y()), | 49 context.fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y()), |
49 IntSize(1, borderRect.height())), | 50 IntSize(1, borderRect.height())), |
50 borderEndEdgeColor()); | 51 borderEndEdgeColor()); |
51 } | 52 } |
52 } | 53 } |
53 | 54 |
54 void FrameSetPainter::paintRowBorder(const PaintInfo& paintInfo, | 55 void FrameSetPainter::paintRowBorder(const PaintInfo& paintInfo, |
55 const IntRect& borderRect) { | 56 const IntRect& borderRect) { |
56 // FIXME: We should do something clever when borders from distinct framesets | 57 // FIXME: We should do something clever when borders from distinct framesets |
57 // meet at a join. | 58 // meet at a join. |
58 | 59 |
59 // Fill first. | 60 // Fill first. |
60 GraphicsContext& context = paintInfo.context; | 61 GraphicsContext& context = paintInfo.context; |
61 context.fillRect(borderRect, m_layoutFrameSet.frameSet()->hasBorderColor() | 62 context.fillRect( |
62 ? m_layoutFrameSet.resolveColor( | 63 borderRect, |
63 CSSPropertyBorderLeftColor) | 64 m_layoutFrameSet.frameSet()->hasBorderColor() |
64 : borderFillColor()); | 65 ? m_layoutFrameSet.resolveColor(CSSPropertyBorderLeftColor) |
| 66 : borderFillColor()); |
65 | 67 |
66 // Now stroke the edges but only if we have enough room to paint both edges | 68 // Now stroke the edges but only if we have enough room to paint both edges |
67 // with a little bit of the fill color showing through. | 69 // with a little bit of the fill color showing through. |
68 if (borderRect.height() >= 3) { | 70 if (borderRect.height() >= 3) { |
69 context.fillRect( | 71 context.fillRect( |
70 IntRect(borderRect.location(), IntSize(borderRect.width(), 1)), | 72 IntRect(borderRect.location(), IntSize(borderRect.width(), 1)), |
71 borderStartEdgeColor()); | 73 borderStartEdgeColor()); |
72 context.fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1), | 74 context.fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1), |
73 IntSize(borderRect.width(), 1)), | 75 IntSize(borderRect.width(), 1)), |
74 borderEndEdgeColor()); | 76 borderEndEdgeColor()); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 LayoutObject* child = m_layoutFrameSet.firstChild(); | 160 LayoutObject* child = m_layoutFrameSet.firstChild(); |
159 if (!child) | 161 if (!child) |
160 return; | 162 return; |
161 | 163 |
162 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location(); | 164 LayoutPoint adjustedPaintOffset = paintOffset + m_layoutFrameSet.location(); |
163 paintChildren(paintInfo, adjustedPaintOffset); | 165 paintChildren(paintInfo, adjustedPaintOffset); |
164 paintBorders(paintInfo, adjustedPaintOffset); | 166 paintBorders(paintInfo, adjustedPaintOffset); |
165 } | 167 } |
166 | 168 |
167 } // namespace blink | 169 } // namespace blink |
OLD | NEW |