| 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/FieldsetPainter.h" | 5 #include "core/paint/FieldsetPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutFieldset.h" | 7 #include "core/layout/LayoutFieldset.h" |
| 8 #include "core/paint/BoxDecorationData.h" | 8 #include "core/paint/BoxDecorationData.h" |
| 9 #include "core/paint/BoxPainter.h" | 9 #include "core/paint/BoxPainter.h" |
| 10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| 11 #include "core/paint/PaintInfo.h" | 11 #include "core/paint/PaintInfo.h" |
| 12 #include "platform/graphics/GraphicsContextStateSaver.h" | 12 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 void FieldsetPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, c
onst LayoutPoint& paintOffset) | 16 void FieldsetPainter::paintBoxDecorationBackground(const PaintInfo& paintInfo, c
onst LayoutPoint& paintOffset) |
| 17 { | 17 { |
| 18 if (!paintInfo.shouldPaintWithinRoot(&m_layoutFieldset)) |
| 19 return; |
| 20 |
| 18 LayoutRect paintRect(paintOffset, m_layoutFieldset.size()); | 21 LayoutRect paintRect(paintOffset, m_layoutFieldset.size()); |
| 19 LayoutBox* legend = m_layoutFieldset.findInFlowLegend(); | 22 LayoutBox* legend = m_layoutFieldset.findInFlowLegend(); |
| 20 if (!legend) | 23 if (!legend) |
| 21 return BoxPainter(m_layoutFieldset).paintBoxDecorationBackground(paintIn
fo, paintOffset); | 24 return BoxPainter(m_layoutFieldset).paintBoxDecorationBackground(paintIn
fo, paintOffset); |
| 22 | 25 |
| 23 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutFieldset, paintInfo.phase, paintOffset)) | 26 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutFieldset, paintInfo.phase, paintOffset)) |
| 24 return; | 27 return; |
| 25 | 28 |
| 26 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos
e | 29 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos
e |
| 27 // cases the legend is embedded in the right and bottom borders respectively
. | 30 // cases the legend is embedded in the right and bottom borders respectively
. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_layoutFieldset.borderLeft()) / 2; | 94 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_layoutFieldset.borderLeft()) / 2; |
| 92 paintRect.expand(-xOff, 0); | 95 paintRect.expand(-xOff, 0); |
| 93 paintRect.move(xOff, 0); | 96 paintRect.move(xOff, 0); |
| 94 } | 97 } |
| 95 | 98 |
| 96 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutFieldset, pa
intInfo.phase, paintRect, paintOffset); | 99 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutFieldset, pa
intInfo.phase, paintRect, paintOffset); |
| 97 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); | 100 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); |
| 98 } | 101 } |
| 99 | 102 |
| 100 } // namespace blink | 103 } // namespace blink |
| OLD | NEW |