Index: Source/core/rendering/svg/SVGRenderSupport.cpp |
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp |
index 2a51b9ce6fd21cf817a9d8b5c0014625ef3dd8c1..7885d93525a2426e2f26e57cc7244c0825d91283 100644 |
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp |
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp |
@@ -394,6 +394,39 @@ void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, cons |
strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(lengthContext)); |
} |
+bool SVGRenderSupport::updateGraphicsContext(GraphicsContextStateSaver& stateSaver, RenderStyle* style, RenderObject& renderer, unsigned resourceModeFlags) |
+{ |
+ ASSERT(style); |
+ |
+ RenderSVGResourceMode resourceMode = static_cast<RenderSVGResourceMode>(resourceModeFlags & (ApplyToFillMode | ApplyToStrokeMode)); |
+ ASSERT(resourceMode == ApplyToFillMode || resourceMode == ApplyToStrokeMode); |
+ |
+ GraphicsContext* context = stateSaver.context(); |
+ if (isRenderingClipPathAsMaskImage(renderer)) { |
+ if (resourceMode == ApplyToStrokeMode) |
+ return false; |
+ context->setAlphaAsFloat(1); |
+ context->setFillColor(SVGRenderStyle::initialFillPaintColor()); |
+ return true; |
+ } |
+ |
+ SVGPaintServer paintServer = SVGPaintServer::requestForRenderer(renderer, style, resourceModeFlags); |
+ if (!paintServer.isValid()) |
+ return false; |
+ paintServer.apply(*context, resourceMode, &stateSaver); |
+ |
+ const SVGRenderStyle& svgStyle = style->svgStyle(); |
+ |
+ if (resourceMode == ApplyToFillMode) { |
+ context->setAlphaAsFloat(svgStyle.fillOpacity()); |
+ context->setFillRule(svgStyle.fillRule()); |
+ } else { |
+ context->setAlphaAsFloat(svgStyle.strokeOpacity()); |
+ applyStrokeStyleToContext(context, style, &renderer); |
+ } |
+ return true; |
+} |
+ |
void SVGRenderSupport::fillOrStrokePath(GraphicsContext* context, unsigned short resourceMode, const Path& path) |
{ |
if (resourceMode & ApplyToFillMode) |