| 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 | |
| 21 LayoutRect paintRect(paintOffset, m_layoutFieldset.size()); | 18 LayoutRect paintRect(paintOffset, m_layoutFieldset.size()); |
| 22 LayoutBox* legend = m_layoutFieldset.findInFlowLegend(); | 19 LayoutBox* legend = m_layoutFieldset.findInFlowLegend(); |
| 23 if (!legend) | 20 if (!legend) |
| 24 return BoxPainter(m_layoutFieldset).paintBoxDecorationBackground(paintIn
fo, paintOffset); | 21 return BoxPainter(m_layoutFieldset).paintBoxDecorationBackground(paintIn
fo, paintOffset); |
| 25 | 22 |
| 26 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutFieldset, paintInfo.phase, paintOffset)) | 23 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex
t, m_layoutFieldset, paintInfo.phase, paintOffset)) |
| 27 return; | 24 return; |
| 28 | 25 |
| 29 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos
e | 26 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos
e |
| 30 // cases the legend is embedded in the right and bottom borders respectively
. | 27 // 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... |
| 94 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_layoutFieldset.borderLeft()) / 2; | 91 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_layoutFieldset.borderLeft()) / 2; |
| 95 paintRect.expand(-xOff, 0); | 92 paintRect.expand(-xOff, 0); |
| 96 paintRect.move(xOff, 0); | 93 paintRect.move(xOff, 0); |
| 97 } | 94 } |
| 98 | 95 |
| 99 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutFieldset, pa
intInfo.phase, paintRect, paintOffset); | 96 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutFieldset, pa
intInfo.phase, paintRect, paintOffset); |
| 100 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); | 97 BoxPainter(m_layoutFieldset).paintMaskImages(paintInfo, paintRect); |
| 101 } | 98 } |
| 102 | 99 |
| 103 } // namespace blink | 100 } // namespace blink |
| OLD | NEW |