| 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/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/RenderDrawingRecorder.h" | 10 #include "core/paint/RenderDrawingRecorder.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 if (m_renderFieldset.style()->isHorizontalWritingMode()) { | 29 if (m_renderFieldset.style()->isHorizontalWritingMode()) { |
| 30 LayoutUnit yOff = (legend->location().y() > 0) ? LayoutUnit() : (legend-
>size().height() - m_renderFieldset.borderTop()) / 2; | 30 LayoutUnit yOff = (legend->location().y() > 0) ? LayoutUnit() : (legend-
>size().height() - m_renderFieldset.borderTop()) / 2; |
| 31 paintRect.setHeight(paintRect.height() - yOff); | 31 paintRect.setHeight(paintRect.height() - yOff); |
| 32 paintRect.setY(paintRect.y() + yOff); | 32 paintRect.setY(paintRect.y() + yOff); |
| 33 } else { | 33 } else { |
| 34 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_renderFieldset.borderLeft()) / 2; | 34 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_renderFieldset.borderLeft()) / 2; |
| 35 paintRect.setWidth(paintRect.width() - xOff); | 35 paintRect.setWidth(paintRect.width() - xOff); |
| 36 paintRect.setX(paintRect.x() + xOff); | 36 paintRect.setX(paintRect.x() + xOff); |
| 37 } | 37 } |
| 38 | 38 |
| 39 RenderDrawingRecorder recorder(paintInfo.context, m_renderFieldset, paintInf
o.phase, pixelSnappedIntRect(paintOffset, paintRect.size())); |
| 40 if (recorder.canUseCachedDrawing()) |
| 41 return; |
| 42 |
| 39 BoxDecorationData boxDecorationData(*m_renderFieldset.style(), m_renderField
set.canRenderBorderImage(), m_renderFieldset.backgroundHasOpaqueTopLayer(), m_re
nderFieldset.backgroundShouldAlwaysBeClipped(), paintInfo.context); | 43 BoxDecorationData boxDecorationData(*m_renderFieldset.style(), m_renderField
set.canRenderBorderImage(), m_renderFieldset.backgroundHasOpaqueTopLayer(), m_re
nderFieldset.backgroundShouldAlwaysBeClipped(), paintInfo.context); |
| 40 RenderDrawingRecorder recorder(paintInfo.context, &m_renderFieldset, paintIn
fo.phase, pixelSnappedIntRect(paintOffset, paintRect.size())); | |
| 41 | 44 |
| 42 if (boxDecorationData.bleedAvoidance() == BackgroundBleedNone) | 45 if (boxDecorationData.bleedAvoidance() == BackgroundBleedNone) |
| 43 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_renderFieldset.style(
), Normal); | 46 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_renderFieldset.style(
), Normal); |
| 44 BoxPainter(m_renderFieldset).paintFillLayers(paintInfo, boxDecorationData.ba
ckgroundColor, m_renderFieldset.style()->backgroundLayers(), paintRect); | 47 BoxPainter(m_renderFieldset).paintFillLayers(paintInfo, boxDecorationData.ba
ckgroundColor, m_renderFieldset.style()->backgroundLayers(), paintRect); |
| 45 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_renderFieldset.style(), I
nset); | 48 BoxPainter::paintBoxShadow(paintInfo, paintRect, m_renderFieldset.style(), I
nset); |
| 46 | 49 |
| 47 if (!boxDecorationData.hasBorder) | 50 if (!boxDecorationData.hasBorder) |
| 48 return; | 51 return; |
| 49 | 52 |
| 50 // Create a clipping region around the legend and paint the border as normal | 53 // Create a clipping region around the legend and paint the border as normal |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } else { | 90 } else { |
| 88 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_renderFieldset.borderLeft()) / 2; | 91 LayoutUnit xOff = (legend->location().x() > 0) ? LayoutUnit() : (legend-
>size().width() - m_renderFieldset.borderLeft()) / 2; |
| 89 paintRect.expand(-xOff, 0); | 92 paintRect.expand(-xOff, 0); |
| 90 paintRect.move(xOff, 0); | 93 paintRect.move(xOff, 0); |
| 91 } | 94 } |
| 92 | 95 |
| 93 BoxPainter(m_renderFieldset).paintMaskImages(paintInfo, paintRect); | 96 BoxPainter(m_renderFieldset).paintMaskImages(paintInfo, paintRect); |
| 94 } | 97 } |
| 95 | 98 |
| 96 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |