| 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/PartPainter.h" | 6 #include "core/paint/PartPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutPart.h" | 8 #include "core/layout/LayoutPart.h" |
| 9 #include "core/paint/BoxPainter.h" | 9 #include "core/paint/BoxPainter.h" |
| 10 #include "core/paint/DeprecatedPaintLayer.h" | 10 #include "core/paint/DeprecatedPaintLayer.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size()); | 26 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size()); |
| 27 | 27 |
| 28 if (m_layoutPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPh
aseForeground || paintInfo.phase == PaintPhaseSelection)) | 28 if (m_layoutPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPh
aseForeground || paintInfo.phase == PaintPhaseSelection)) |
| 29 BoxPainter(m_layoutPart).paintBoxDecorationBackground(paintInfo, adjuste
dPaintOffset); | 29 BoxPainter(m_layoutPart).paintBoxDecorationBackground(paintInfo, adjuste
dPaintOffset); |
| 30 | 30 |
| 31 if (paintInfo.phase == PaintPhaseMask) { | 31 if (paintInfo.phase == PaintPhaseMask) { |
| 32 BoxPainter(m_layoutPart).paintMask(paintInfo, adjustedPaintOffset); | 32 BoxPainter(m_layoutPart).paintMask(paintInfo, adjustedPaintOffset); |
| 33 return; | 33 return; |
| 34 } | 34 } |
| 35 | 35 |
| 36 LayoutRect visualOverflowRect(m_layoutPart.visualOverflowRect()); | |
| 37 visualOverflowRect.moveBy(adjustedPaintOffset); | |
| 38 | |
| 39 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe
lfOutline) && m_layoutPart.style()->hasOutline()) | 36 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe
lfOutline) && m_layoutPart.style()->hasOutline()) |
| 40 ObjectPainter(m_layoutPart).paintOutline(paintInfo, borderRect, visualOv
erflowRect); | 37 ObjectPainter(m_layoutPart).paintOutline(paintInfo, m_layoutPart.visualO
verflowRect(), borderRect.size(), adjustedPaintOffset); |
| 41 | 38 |
| 42 if (paintInfo.phase != PaintPhaseForeground) | 39 if (paintInfo.phase != PaintPhaseForeground) |
| 43 return; | 40 return; |
| 44 | 41 |
| 45 { | 42 { |
| 46 Optional<RoundedInnerRectClipper> clipper; | 43 Optional<RoundedInnerRectClipper> clipper; |
| 47 if (m_layoutPart.style()->hasBorderRadius()) { | 44 if (m_layoutPart.style()->hasBorderRadius()) { |
| 48 if (borderRect.isEmpty()) | 45 if (borderRect.isEmpty()) |
| 49 return; | 46 return; |
| 50 | 47 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 IntSize widgetPaintOffset = paintLocation - widgetLocation; | 89 IntSize widgetPaintOffset = paintLocation - widgetLocation; |
| 93 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, | 90 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, |
| 94 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plugin drawing. | 91 // not the root. In this case, shift the CTM and adjust the paintRect to be
root-relative to fix plugin drawing. |
| 95 TransformRecorder transform(*paintInfo.context, m_layoutPart, | 92 TransformRecorder transform(*paintInfo.context, m_layoutPart, |
| 96 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); | 93 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); |
| 97 paintRect.move(-widgetPaintOffset); | 94 paintRect.move(-widgetPaintOffset); |
| 98 widget->paint(paintInfo.context, paintRect); | 95 widget->paint(paintInfo.context, paintRect); |
| 99 } | 96 } |
| 100 | 97 |
| 101 } // namespace blink | 98 } // namespace blink |
| OLD | NEW |