Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1450)

Unified Diff: Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp

Issue 559653006: Align assumptions in RenderSVGResourceSolidColor with other paint servers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Align further after SVG-font change. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698