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

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

Issue 900463002: Make SVG painting independent of GraphicsContext's alpha state (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address reviewer comments Created 5 years, 10 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/core/rendering/svg/SVGRenderSupport.cpp
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp
index 8e0f0b2b7e15d6c6fcfeedb9c6f84b54f6911572..3b0d73be640a9cebe7888aa21f51c769a3119762 100644
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp
@@ -407,7 +407,6 @@ bool SVGRenderSupport::updateGraphicsContext(const PaintInfo& paintInfo, Graphic
if (paintInfo.isRenderingClipPathAsMaskImage()) {
if (resourceMode == ApplyToStrokeMode)
return false;
- context->setAlphaAsFloat(1);
context->setFillColor(SVGRenderStyle::initialFillPaintColor());
return true;
}
@@ -419,17 +418,15 @@ bool SVGRenderSupport::updateGraphicsContext(const PaintInfo& paintInfo, Graphic
if (additionalPaintServerTransform && paintServer.isTransformDependent())
paintServer.prependTransform(*additionalPaintServerTransform);
- paintServer.apply(*context, resourceMode, &stateSaver);
-
const SVGRenderStyle& svgStyle = style.svgStyle();
+ float paintAlpha = resourceMode == ApplyToFillMode ? svgStyle.fillOpacity() : svgStyle.strokeOpacity();
+ paintServer.apply(*context, resourceMode, paintAlpha, stateSaver);
- if (resourceMode == ApplyToFillMode) {
- context->setAlphaAsFloat(svgStyle.fillOpacity());
+ if (resourceMode == ApplyToFillMode)
context->setFillRule(svgStyle.fillRule());
- } else {
- context->setAlphaAsFloat(svgStyle.strokeOpacity());
+ else
applyStrokeStyleToContext(context, style, &renderer);
- }
+
return true;
}
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourcePaintServer.cpp ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698