| 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 24 matching lines...) Expand all Loading... |
| 35 LayoutRect visualOverflowRect(m_layoutPart.visualOverflowRect()); | 35 LayoutRect visualOverflowRect(m_layoutPart.visualOverflowRect()); |
| 36 visualOverflowRect.moveBy(adjustedPaintOffset); | 36 visualOverflowRect.moveBy(adjustedPaintOffset); |
| 37 | 37 |
| 38 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe
lfOutline) && m_layoutPart.style()->hasOutline()) | 38 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe
lfOutline) && m_layoutPart.style()->hasOutline()) |
| 39 ObjectPainter(m_layoutPart).paintOutline(paintInfo, borderRect, visualOv
erflowRect); | 39 ObjectPainter(m_layoutPart).paintOutline(paintInfo, borderRect, visualOv
erflowRect); |
| 40 | 40 |
| 41 if (paintInfo.phase != PaintPhaseForeground) | 41 if (paintInfo.phase != PaintPhaseForeground) |
| 42 return; | 42 return; |
| 43 | 43 |
| 44 { | 44 { |
| 45 OwnPtr<RoundedInnerRectClipper> clipper; | 45 RoundedInnerRectClipper clipper(m_layoutPart, paintInfo); |
| 46 if (m_layoutPart.style()->hasBorderRadius()) { | 46 if (m_layoutPart.style()->hasBorderRadius()) { |
| 47 if (borderRect.isEmpty()) | 47 if (borderRect.isEmpty()) |
| 48 return; | 48 return; |
| 49 | 49 |
| 50 FloatRoundedRect roundedInnerRect = m_layoutPart.style()->getRounded
InnerBorderFor(borderRect, | 50 FloatRoundedRect roundedInnerRect = m_layoutPart.style()->getRounded
InnerBorderFor(borderRect, |
| 51 LayoutRectOutsets( | 51 LayoutRectOutsets( |
| 52 -(m_layoutPart.paddingTop() + m_layoutPart.borderTop()), | 52 -(m_layoutPart.paddingTop() + m_layoutPart.borderTop()), |
| 53 -(m_layoutPart.paddingRight() + m_layoutPart.borderRight()), | 53 -(m_layoutPart.paddingRight() + m_layoutPart.borderRight()), |
| 54 -(m_layoutPart.paddingBottom() + m_layoutPart.borderBottom()
), | 54 -(m_layoutPart.paddingBottom() + m_layoutPart.borderBottom()
), |
| 55 -(m_layoutPart.paddingLeft() + m_layoutPart.borderLeft())), | 55 -(m_layoutPart.paddingLeft() + m_layoutPart.borderLeft())), |
| 56 true, true); | 56 true, true); |
| 57 clipper = adoptPtr(new RoundedInnerRectClipper(m_layoutPart, paintIn
fo, borderRect, roundedInnerRect, ApplyToDisplayListIfEnabled)); | 57 clipper.begin(borderRect, roundedInnerRect, ApplyToDisplayListIfEnab
led); |
| 58 } | 58 } |
| 59 | 59 |
| 60 if (m_layoutPart.widget()) | 60 if (m_layoutPart.widget()) |
| 61 m_layoutPart.paintContents(paintInfo, paintOffset); | 61 m_layoutPart.paintContents(paintInfo, paintOffset); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // Paint a partially transparent wash over selected widgets. | 64 // Paint a partially transparent wash over selected widgets. |
| 65 if (m_layoutPart.isSelected() && !m_layoutPart.document().printing()) { | 65 if (m_layoutPart.isSelected() && !m_layoutPart.document().printing()) { |
| 66 LayoutRect rect = m_layoutPart.localSelectionRect(); | 66 LayoutRect rect = m_layoutPart.localSelectionRect(); |
| 67 rect.moveBy(adjustedPaintOffset); | 67 rect.moveBy(adjustedPaintOffset); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 92 IntSize widgetPaintOffset = paintLocation - widgetLocation; | 92 IntSize widgetPaintOffset = paintLocation - widgetLocation; |
| 93 // When painting widgets into compositing layers, tx and ty are relative to
the enclosing compositing layer, | 93 // 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. | 94 // 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, | 95 TransformRecorder transform(*paintInfo.context, m_layoutPart, |
| 96 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); | 96 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse
t.height())); |
| 97 paintRect.move(-widgetPaintOffset); | 97 paintRect.move(-widgetPaintOffset); |
| 98 widget->paint(paintInfo.context, paintRect); | 98 widget->paint(paintInfo.context, paintRect); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |