#include "core/rendering/svg/RenderSVGText.h"
#include "core/editing/PositionWithAffinity.h"
+#include "core/paint/SVGTextPainter.h"
#include "core/rendering/HitTestRequest.h"
#include "core/rendering/HitTestResult.h"
#include "core/rendering/PaintInfo.h"
#include "platform/fonts/SimpleFontData.h"
#include "platform/geometry/FloatQuad.h"
#include "platform/geometry/TransformState.h"
-#include "platform/graphics/GraphicsContextStateSaver.h"
namespace blink {
return toRenderSVGText(start);
}
-void RenderSVGText::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, ViewportConstrainedPosition, const PaintInvalidationState* paintInvalidationState) const
+void RenderSVGText::mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const
{
FloatRect paintInvalidationRect = rect;
+ paintInvalidationRect.inflate(style()->outlineWidth());
computeFloatRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationRect, paintInvalidationState);
rect = enclosingLayoutRect(paintInvalidationRect);
}
void RenderSVGText::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
- if (paintInfo.phase != PaintPhaseForeground
- && paintInfo.phase != PaintPhaseSelection)
- return;
-
- PaintInfo blockInfo(paintInfo);
- GraphicsContextStateSaver stateSaver(*blockInfo.context, false);
- const AffineTransform& localTransform = localToParentTransform();
- if (!localTransform.isIdentity()) {
- stateSaver.save();
- blockInfo.applyTransform(localTransform, false);
- }
- RenderBlock::paint(blockInfo, LayoutPoint());
-
- // Paint the outlines, if any
- if (paintInfo.phase == PaintPhaseForeground) {
- blockInfo.phase = PaintPhaseSelfOutline;
- RenderBlock::paint(blockInfo, LayoutPoint());
- }
+ SVGTextPainter(*this).paint(paintInfo);
}
FloatRect RenderSVGText::strokeBoundingBox() const