Index: Source/core/rendering/svg/RenderSVGShape.cpp |
diff --git a/Source/core/rendering/svg/RenderSVGShape.cpp b/Source/core/rendering/svg/RenderSVGShape.cpp |
index 4ae25aa81ac239a132465f6a85a39eb39b537d94..b7b1bf335aca9bde40d2060a72995307ae37b971 100644 |
--- a/Source/core/rendering/svg/RenderSVGShape.cpp |
+++ b/Source/core/rendering/svg/RenderSVGShape.cpp |
@@ -235,61 +235,60 @@ void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context) |
void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) |
{ |
ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); |
- |
- if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || isShapeEmpty()) |
+ if (paintInfo.context->paintingDisabled() |
+ || paintInfo.phase != PaintPhaseForeground |
+ || style()->visibility() == HIDDEN |
+ || isShapeEmpty()) |
return; |
+ |
FloatRect boundingBox = repaintRectInLocalCoordinates(); |
if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo)) |
return; |
PaintInfo childPaintInfo(paintInfo); |
- bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); |
- if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { |
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context); |
- childPaintInfo.applyTransform(m_localTransform); |
- |
- if (childPaintInfo.phase == PaintPhaseForeground) { |
- SVGRenderingContext renderingContext(this, childPaintInfo); |
- |
- if (renderingContext.isRenderingPrepared()) { |
- const SVGRenderStyle* svgStyle = style()->svgStyle(); |
- if (svgStyle->shapeRendering() == SR_CRISPEDGES) |
- childPaintInfo.context->setShouldAntialias(false); |
- |
- for (int i = 0; i < 3; i++) { |
- switch (svgStyle->paintOrderType(i)) { |
- case PT_FILL: |
- fillShape(this->style(), childPaintInfo.context); |
- break; |
- case PT_STROKE: |
- if (svgStyle->hasVisibleStroke()) { |
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false); |
- AffineTransform nonScalingTransform; |
- |
- if (hasNonScalingStroke()) { |
- AffineTransform nonScalingTransform = nonScalingStrokeTransform(); |
- if (!setupNonScalingStrokeContext(nonScalingTransform, stateSaver)) |
- return; |
- } |
- |
- strokeShape(this->style(), childPaintInfo.context); |
- } |
- break; |
- case PT_MARKERS: |
- if (!m_markerPositions.isEmpty()) |
- drawMarkers(childPaintInfo); |
- break; |
- default: |
- ASSERT_NOT_REACHED(); |
- break; |
+ |
+ GraphicsContextStateSaver stateSaver(*childPaintInfo.context); |
+ childPaintInfo.applyTransform(m_localTransform); |
+ |
+ SVGRenderingContext renderingContext(this, childPaintInfo); |
+ |
+ if (renderingContext.isRenderingPrepared()) { |
+ const SVGRenderStyle* svgStyle = style()->svgStyle(); |
+ if (svgStyle->shapeRendering() == SR_CRISPEDGES) |
+ childPaintInfo.context->setShouldAntialias(false); |
+ |
+ for (int i = 0; i < 3; i++) { |
+ switch (svgStyle->paintOrderType(i)) { |
+ case PT_FILL: |
+ fillShape(this->style(), childPaintInfo.context); |
+ break; |
+ case PT_STROKE: |
+ if (svgStyle->hasVisibleStroke()) { |
+ GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false); |
+ AffineTransform nonScalingTransform; |
+ |
+ if (hasNonScalingStroke()) { |
+ AffineTransform nonScalingTransform = nonScalingStrokeTransform(); |
+ if (!setupNonScalingStrokeContext(nonScalingTransform, stateSaver)) |
+ return; |
} |
+ |
+ strokeShape(this->style(), childPaintInfo.context); |
} |
+ break; |
+ case PT_MARKERS: |
+ if (!m_markerPositions.isEmpty()) |
+ drawMarkers(childPaintInfo); |
+ break; |
+ default: |
+ ASSERT_NOT_REACHED(); |
+ break; |
} |
} |
- |
- if (drawsOutline) |
- paintOutline(childPaintInfo, IntRect(boundingBox)); |
} |
+ |
+ if (style()->outlineWidth()) |
+ paintOutline(childPaintInfo, IntRect(boundingBox)); |
} |
// This method is called from inside paintOutline() since we call paintOutline() |