| Index: Source/core/paint/PartPainter.cpp
|
| diff --git a/Source/core/paint/PartPainter.cpp b/Source/core/paint/PartPainter.cpp
|
| index 7885c125eeb875e13689b417ec8e5db70918e048..e329ba4b11ea953beae4a2cdd26f84fc0eb1b4fa 100644
|
| --- a/Source/core/paint/PartPainter.cpp
|
| +++ b/Source/core/paint/PartPainter.cpp
|
| @@ -6,9 +6,11 @@
|
| #include "core/paint/PartPainter.h"
|
|
|
| #include "core/paint/BoxPainter.h"
|
| -
|
| +#include "core/paint/ContentBoxRadiusClipper.h"
|
| #include "core/paint/GraphicsContextAnnotator.h"
|
| +#include "core/paint/RenderDrawingRecorder.h"
|
| #include "core/paint/ScrollableAreaPainter.h"
|
| +#include "core/paint/TransformRecorder.h"
|
| #include "core/rendering/PaintInfo.h"
|
| #include "core/rendering/RenderLayer.h"
|
| #include "core/rendering/RenderPart.h"
|
| @@ -38,30 +40,22 @@ void PartPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffs
|
| if (paintInfo.phase != PaintPhaseForeground)
|
| return;
|
|
|
| - if (m_renderPart.style()->hasBorderRadius()) {
|
| - LayoutRect borderRect = LayoutRect(adjustedPaintOffset, m_renderPart.size());
|
| -
|
| - if (borderRect.isEmpty())
|
| - return;
|
| -
|
| - // Push a clip if we have a border radius, since we want to round the foreground content that gets painted.
|
| - paintInfo.context->save();
|
| - FloatRoundedRect roundedInnerRect = m_renderPart.style()->getRoundedInnerBorderFor(borderRect,
|
| - m_renderPart.paddingTop() + m_renderPart.borderTop(), m_renderPart.paddingBottom() + m_renderPart.borderBottom(), m_renderPart.paddingLeft() + m_renderPart.borderLeft(), m_renderPart.paddingRight() + m_renderPart.borderRight(), true, true);
|
| - BoxPainter::clipRoundedInnerRect(paintInfo.context, borderRect, roundedInnerRect);
|
| - }
|
| + do {
|
| + ContentBoxRadiusClipper clipper(m_renderPart, paintInfo, adjustedPaintOffset);
|
| + if (clipper.completelyClipped())
|
| + break;
|
|
|
| - if (m_renderPart.widget())
|
| - m_renderPart.paintContents(paintInfo, paintOffset);
|
| -
|
| - if (m_renderPart.style()->hasBorderRadius())
|
| - paintInfo.context->restore();
|
| + if (m_renderPart.widget())
|
| + m_renderPart.paintContents(paintInfo, paintOffset);
|
| + } while (0);
|
|
|
| // Paint a partially transparent wash over selected widgets.
|
| if (m_renderPart.isSelected() && !m_renderPart.document().printing()) {
|
| LayoutRect rect = m_renderPart.localSelectionRect();
|
| rect.moveBy(adjustedPaintOffset);
|
| - paintInfo.context->fillRect(pixelSnappedIntRect(rect), m_renderPart.selectionBackgroundColor());
|
| + IntRect selectionRect = pixelSnappedIntRect(rect);
|
| + RenderDrawingRecorder recorder(paintInfo.context, m_renderPart, paintInfo.phase, selectionRect);
|
| + paintInfo.context->fillRect(selectionRect, m_renderPart.selectionBackgroundColor());
|
| }
|
|
|
| if (m_renderPart.canResize())
|
| @@ -85,14 +79,9 @@ void PartPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& p
|
| IntSize widgetPaintOffset = paintLocation - widgetLocation;
|
| // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer,
|
| // not the root. In this case, shift the CTM and adjust the paintRect to be root-relative to fix plug-in drawing.
|
| - if (!widgetPaintOffset.isZero()) {
|
| - paintInfo.context->translate(widgetPaintOffset.width(), widgetPaintOffset.height());
|
| - paintRect.move(-widgetPaintOffset);
|
| - }
|
| + TransformRecorder transform(*paintInfo.context, m_renderPart.displayItemClient(),
|
| + AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffset.height()));
|
| widget->paint(paintInfo.context, paintRect);
|
| -
|
| - if (!widgetPaintOffset.isZero())
|
| - paintInfo.context->translate(-widgetPaintOffset.width(), -widgetPaintOffset.height());
|
| }
|
|
|
| } // namespace blink
|
|
|