Chromium Code Reviews| Index: Source/core/paint/ReplacedPainter.cpp |
| diff --git a/Source/core/paint/ReplacedPainter.cpp b/Source/core/paint/ReplacedPainter.cpp |
| index 0edf96fa1936921c546edc534bd7c40d4deb3e4a..07a0306f9ebfe6f3d5da8345668817aadc33e50c 100644 |
| --- a/Source/core/paint/ReplacedPainter.cpp |
| +++ b/Source/core/paint/ReplacedPainter.cpp |
| @@ -9,6 +9,7 @@ |
| #include "core/paint/GraphicsContextAnnotator.h" |
| #include "core/paint/ObjectPainter.h" |
| #include "core/paint/RenderDrawingRecorder.h" |
| +#include "core/paint/RoundedInnerRectClipper.h" |
| #include "core/rendering/PaintInfo.h" |
| #include "core/rendering/RenderLayer.h" |
| #include "core/rendering/RenderReplaced.h" |
| @@ -61,6 +62,7 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint |
| return; |
| bool completelyClippedOut = false; |
| + OwnPtr<RoundedInnerRectClipper> clipper; |
| if (m_renderReplaced.style()->hasBorderRadius()) { |
| LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_renderReplaced.size()); |
| @@ -71,7 +73,8 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint |
| paintInfo.context->save(); |
| FloatRoundedRect roundedInnerRect = m_renderReplaced.style()->getRoundedInnerBorderFor(paintRect, |
| m_renderReplaced.paddingTop() + m_renderReplaced.borderTop(), m_renderReplaced.paddingBottom() + m_renderReplaced.borderBottom(), m_renderReplaced.paddingLeft() + m_renderReplaced.borderLeft(), m_renderReplaced.paddingRight() + m_renderReplaced.borderRight(), true, true); |
| - BoxPainter::clipRoundedInnerRect(paintInfo.context, paintRect, roundedInnerRect); |
| + |
| + clipper = adoptPtr(new RoundedInnerRectClipper(m_renderReplaced, paintInfo, paintRect, roundedInnerRect, ApplyToContext)); |
| } |
| } |
| @@ -81,10 +84,8 @@ void ReplacedPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paint |
| } else { |
| m_renderReplaced.paintReplaced(paintInfo, adjustedPaintOffset); |
| } |
| - |
| - if (m_renderReplaced.style()->hasBorderRadius()) |
| - paintInfo.context->restore(); |
| } |
| + clipper.clear(); |
|
chrishtr
2015/01/23 23:35:33
Same comment here.
trchen
2015/01/23 23:40:43
Acknowledged.
trchen
2015/01/23 23:47:59
Done.
|
| // The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of |
| // surrounding content. |