| 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/paint/BoxPainter.h" | 8 #include "core/paint/BoxPainter.h" |
| 9 | 9 |
| 10 #include "core/paint/ScrollableAreaPainter.h" | 10 #include "core/paint/ScrollableAreaPainter.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 return; | 39 return; |
| 40 | 40 |
| 41 if (m_renderPart.style()->hasBorderRadius()) { | 41 if (m_renderPart.style()->hasBorderRadius()) { |
| 42 LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_renderPart.siz
e()); | 42 LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_renderPart.siz
e()); |
| 43 | 43 |
| 44 if (borderRect.isEmpty()) | 44 if (borderRect.isEmpty()) |
| 45 return; | 45 return; |
| 46 | 46 |
| 47 // Push a clip if we have a border radius, since we want to round the fo
reground content that gets painted. | 47 // Push a clip if we have a border radius, since we want to round the fo
reground content that gets painted. |
| 48 paintInfo.context->save(); | 48 paintInfo.context->save(); |
| 49 RoundedRect roundedInnerRect = m_renderPart.style()->getRoundedInnerBord
erFor(borderRect, | 49 FloatRoundedRect roundedInnerRect = m_renderPart.style()->getRoundedInne
rBorderFor(borderRect, |
| 50 m_renderPart.paddingTop() + m_renderPart.borderTop(), m_renderPart.p
addingBottom() + m_renderPart.borderBottom(), m_renderPart.paddingLeft() + m_ren
derPart.borderLeft(), m_renderPart.paddingRight() + m_renderPart.borderRight(),
true, true); | 50 m_renderPart.paddingTop() + m_renderPart.borderTop(), m_renderPart.p
addingBottom() + m_renderPart.borderBottom(), m_renderPart.paddingLeft() + m_ren
derPart.borderLeft(), m_renderPart.paddingRight() + m_renderPart.borderRight(),
true, true); |
| 51 BoxPainter::clipRoundedInnerRect(paintInfo.context, borderRect, roundedI
nnerRect); | 51 BoxPainter::clipRoundedInnerRect(paintInfo.context, borderRect, roundedI
nnerRect); |
| 52 } | 52 } |
| 53 | 53 |
| 54 if (m_renderPart.widget()) | 54 if (m_renderPart.widget()) |
| 55 m_renderPart.paintContents(paintInfo, paintOffset); | 55 m_renderPart.paintContents(paintInfo, paintOffset); |
| 56 | 56 |
| 57 if (m_renderPart.style()->hasBorderRadius()) | 57 if (m_renderPart.style()->hasBorderRadius()) |
| 58 paintInfo.context->restore(); | 58 paintInfo.context->restore(); |
| 59 | 59 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 89 paintInfo.context->translate(widgetPaintOffset.width(), widgetPaintOffse
t.height()); | 89 paintInfo.context->translate(widgetPaintOffset.width(), widgetPaintOffse
t.height()); |
| 90 paintRect.move(-widgetPaintOffset); | 90 paintRect.move(-widgetPaintOffset); |
| 91 } | 91 } |
| 92 widget->paint(paintInfo.context, paintRect); | 92 widget->paint(paintInfo.context, paintRect); |
| 93 | 93 |
| 94 if (!widgetPaintOffset.isZero()) | 94 if (!widgetPaintOffset.isZero()) |
| 95 paintInfo.context->translate(-widgetPaintOffset.width(), -widgetPaintOff
set.height()); | 95 paintInfo.context->translate(-widgetPaintOffset.width(), -widgetPaintOff
set.height()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace blink | 98 } // namespace blink |
| OLD | NEW |