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

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

Issue 9235065: Merge 105978 - crash in WebCore::RenderSVGContainer::paint (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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
Index: Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp
===================================================================
--- Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp (revision 106008)
+++ Source/WebCore/rendering/svg/RenderSVGResourceSolidColor.cpp (working copy)
@@ -54,15 +54,25 @@
const SVGRenderStyle* svgStyle = style ? style->svgStyle() : 0;
ColorSpace colorSpace = style ? style->colorSpace() : ColorSpaceDeviceRGB;
+ bool isRenderingMask = false;
+ if (object->frame() && object->frame()->view())
+ isRenderingMask = object->frame()->view()->paintBehavior() & PaintBehaviorRenderingSVGMask;
+
if (resourceMode & ApplyToFillMode) {
- context->setAlpha(svgStyle ? svgStyle->fillOpacity() : 1.0f);
+ if (!isRenderingMask && svgStyle)
+ context->setAlpha(svgStyle->fillOpacity());
+ else
+ context->setAlpha(1);
context->setFillColor(m_color, colorSpace);
- context->setFillRule(svgStyle ? svgStyle->fillRule() : RULE_NONZERO);
+ if (!isRenderingMask)
+ context->setFillRule(svgStyle ? svgStyle->fillRule() : RULE_NONZERO);
if (resourceMode & ApplyToTextMode)
context->setTextDrawingMode(TextModeFill);
} else if (resourceMode & ApplyToStrokeMode) {
- context->setAlpha(svgStyle ? svgStyle->strokeOpacity() : 1.0f);
+ // When rendering the mask for a RenderSVGResourceClipper, the stroke code path is never hit.
+ ASSERT(!isRenderingMask);
+ context->setAlpha(svgStyle ? svgStyle->strokeOpacity() : 1);
context->setStrokeColor(m_color, colorSpace);
if (style)
« no previous file with comments | « Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp ('k') | Source/WebCore/rendering/svg/SVGImageBufferTools.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698