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/FieldsetPainter.h" | 6 #include "core/paint/FieldsetPainter.h" |
7 | 7 |
8 #include "core/layout/LayoutFieldset.h" | 8 #include "core/layout/LayoutFieldset.h" |
9 #include "core/paint/BoxDecorationData.h" | 9 #include "core/paint/BoxDecorationData.h" |
10 #include "core/paint/BoxPainter.h" | 10 #include "core/paint/BoxPainter.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 if (m_layoutFieldset.style()->isHorizontalWritingMode()) { | 33 if (m_layoutFieldset.style()->isHorizontalWritingMode()) { |
34 LayoutUnit yOff = (legend->location().y() > 0) ? LayoutUnit() : (legend- >size().height() - m_layoutFieldset.borderTop()) / 2; | 34 LayoutUnit yOff = (legend->location().y() > 0) ? LayoutUnit() : (legend- >size().height() - m_layoutFieldset.borderTop()) / 2; |
35 paintRect.setHeight(paintRect.height() - yOff); | 35 paintRect.setHeight(paintRect.height() - yOff); |
36 paintRect.setY(paintRect.y() + yOff); | 36 paintRect.setY(paintRect.y() + yOff); |
37 } else { | 37 } else { |
38 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend- >size().width() - m_layoutFieldset.borderLeft()) / 2; | 38 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend- >size().width() - m_layoutFieldset.borderLeft()) / 2; |
39 paintRect.setWidth(paintRect.width() - xOff); | 39 paintRect.setWidth(paintRect.width() - xOff); |
40 paintRect.setX(paintRect.x() + xOff); | 40 paintRect.setX(paintRect.x() + xOff); |
41 } | 41 } |
42 | 42 |
43 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutFieldset, p aintInfo.phase, pixelSnappedIntRect(paintRect)); | 43 // TODO(chrishtr): pixel-snapping here is likely wrong. |
44 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutFieldset, p aintInfo.phase, LayoutRect(pixelSnappedIntRect(paintRect))); | |
jbroman
2015/08/26 19:06:43
as before, this is currently an IntRect->FloatRect
| |
44 BoxDecorationData boxDecorationData(m_layoutFieldset); | 45 BoxDecorationData boxDecorationData(m_layoutFieldset); |
45 | 46 |
46 if (boxDecorationData.bleedAvoidance == BackgroundBleedNone) | 47 if (boxDecorationData.bleedAvoidance == BackgroundBleedNone) |
47 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleR ef(), Normal); | 48 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleR ef(), Normal); |
48 BoxPainter(m_layoutFieldset).paintFillLayers(paintInfo, boxDecorationData.ba ckgroundColor, m_layoutFieldset.style()->backgroundLayers(), paintRect); | 49 BoxPainter(m_layoutFieldset).paintFillLayers(paintInfo, boxDecorationData.ba ckgroundColor, m_layoutFieldset.style()->backgroundLayers(), paintRect); |
49 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleRef() , Inset); | 50 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_layoutFieldset.styleRef() , Inset); |
50 | 51 |
51 if (!boxDecorationData.hasBorderDecoration) | 52 if (!boxDecorationData.hasBorderDecoration) |
52 return; | 53 return; |
53 | 54 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend- >size().width() - m_layoutFieldset.borderLeft()) / 2; | 96 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend- >size().width() - m_layoutFieldset.borderLeft()) / 2; |
96 paintRect.expand(-xOff, 0); | 97 paintRect.expand(-xOff, 0); |
97 paintRect.move(xOff, 0); | 98 paintRect.move(xOff, 0); |
98 } | 99 } |
99 | 100 |
100 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutFieldset, p aintInfo.phase, paintRect); | 101 LayoutObjectDrawingRecorder recorder(*paintInfo.context, m_layoutFieldset, p aintInfo.phase, paintRect); |
101 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); | 102 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); |
102 } | 103 } |
103 | 104 |
104 } // namespace blink | 105 } // namespace blink |
OLD | NEW |