Index: Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp |
diff --git a/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp b/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp |
index be62a3e52aee7b19e56edae6439a7320273e336b..53e0bac1b0bb81951d96220001f37f44e95d29cb 100644 |
--- a/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp |
+++ b/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp |
@@ -42,37 +42,35 @@ RenderSVGResourceSolidColor::~RenderSVGResourceSolidColor() |
bool RenderSVGResourceSolidColor::applyResource(RenderObject* object, RenderStyle* style, GraphicsContext*& context, unsigned short resourceMode) |
{ |
- // We are NOT allowed to ASSERT(object) here, unlike all other resources. |
- // RenderSVGResourceSolidColor is the only resource which may be used from HTML, when rendering |
- // SVG Fonts for a HTML document. This will be indicated by a null RenderObject pointer. |
+ ASSERT(object); |
+ ASSERT(style); |
ASSERT(context); |
ASSERT(resourceMode != ApplyToDefaultMode); |
- const SVGRenderStyle* svgStyle = style ? &style->svgStyle() : 0; |
- |
bool isRenderingMask = false; |
if (object->frame() && object->frame()->view()) |
isRenderingMask = object->frame()->view()->paintBehavior() & PaintBehaviorRenderingSVGMask; |
+ const SVGRenderStyle& svgStyle = style->svgStyle(); |
+ |
if (resourceMode & ApplyToFillMode) { |
- if (!isRenderingMask && svgStyle) |
- context->setAlphaAsFloat(svgStyle->fillOpacity()); |
+ if (!isRenderingMask) |
+ context->setAlphaAsFloat(svgStyle.fillOpacity()); |
else |
context->setAlphaAsFloat(1); |
context->setFillColor(m_color); |
if (!isRenderingMask) |
- context->setFillRule(svgStyle ? svgStyle->fillRule() : RULE_NONZERO); |
+ context->setFillRule(svgStyle.fillRule()); |
if (resourceMode & ApplyToTextMode) |
context->setTextDrawingMode(TextModeFill); |
} else if (resourceMode & ApplyToStrokeMode) { |
// When rendering the mask for a RenderSVGResourceClipper, the stroke code path is never hit. |
ASSERT(!isRenderingMask); |
- context->setAlphaAsFloat(svgStyle ? svgStyle->strokeOpacity() : 1); |
+ context->setAlphaAsFloat(svgStyle.strokeOpacity()); |
context->setStrokeColor(m_color); |
- if (style) |
- SVGRenderSupport::applyStrokeStyleToContext(context, style, object); |
+ SVGRenderSupport::applyStrokeStyleToContext(context, style, object); |
if (resourceMode & ApplyToTextMode) |
context->setTextDrawingMode(TextModeStroke); |