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

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

Issue 630903003: Move common GC state update code out of paint-server application (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move updateGraphicsContext. Created 6 years, 2 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 | « Source/core/rendering/svg/RenderSVGResourcePattern.cpp ('k') | 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 50097cf116b90b6b1311e106fff9e40623c54889..305a07866ae3f49de3691f41ceb14ee4f1599176 100644
--- a/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp
@@ -40,37 +40,17 @@ RenderSVGResourceSolidColor::~RenderSVGResourceSolidColor()
bool RenderSVGResourceSolidColor::applyResource(RenderObject* object, RenderStyle* style, GraphicsContext* context, RenderSVGResourceModeFlags resourceMode)
{
- ASSERT(object);
- ASSERT(style);
+ ASSERT_UNUSED(object, object);
+ ASSERT_UNUSED(style, style);
ASSERT(context);
ASSERT_UNUSED(resourceMode, resourceMode);
- bool isRenderingMask = SVGRenderSupport::isRenderingClipPathAsMaskImage(*object);
- const SVGRenderStyle& svgStyle = style->svgStyle();
-
- if (resourceMode & ApplyToFillMode) {
- if (!isRenderingMask)
- context->setAlphaAsFloat(svgStyle.fillOpacity());
- else
- context->setAlphaAsFloat(1);
+ if (resourceMode & ApplyToFillMode)
context->setFillColor(m_color);
- if (!isRenderingMask)
- 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.strokeOpacity());
+ else if (resourceMode & ApplyToStrokeMode)
context->setStrokeColor(m_color);
- SVGRenderSupport::applyStrokeStyleToContext(context, style, object);
-
- if (resourceMode & ApplyToTextMode)
- context->setTextDrawingMode(TextModeStroke);
- }
-
+ updateGraphicsContext(context, style, *object, resourceMode);
return true;
}
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourcePattern.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698