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

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

Issue 638933002: Introduce SVGPaintServer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Disambiguate. 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
Index: Source/core/rendering/svg/SVGRenderSupport.cpp
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp
index 2a51b9ce6fd21cf817a9d8b5c0014625ef3dd8c1..7885d93525a2426e2f26e57cc7244c0825d91283 100644
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp
@@ -394,6 +394,39 @@ void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, cons
strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(lengthContext));
}
+bool SVGRenderSupport::updateGraphicsContext(GraphicsContextStateSaver& stateSaver, RenderStyle* style, RenderObject& renderer, unsigned resourceModeFlags)
+{
+ ASSERT(style);
+
+ RenderSVGResourceMode resourceMode = static_cast<RenderSVGResourceMode>(resourceModeFlags & (ApplyToFillMode | ApplyToStrokeMode));
+ ASSERT(resourceMode == ApplyToFillMode || resourceMode == ApplyToStrokeMode);
+
+ GraphicsContext* context = stateSaver.context();
+ if (isRenderingClipPathAsMaskImage(renderer)) {
+ if (resourceMode == ApplyToStrokeMode)
+ return false;
+ context->setAlphaAsFloat(1);
+ context->setFillColor(SVGRenderStyle::initialFillPaintColor());
+ return true;
+ }
+
+ SVGPaintServer paintServer = SVGPaintServer::requestForRenderer(renderer, style, resourceModeFlags);
+ if (!paintServer.isValid())
+ return false;
+ paintServer.apply(*context, resourceMode, &stateSaver);
+
+ const SVGRenderStyle& svgStyle = style->svgStyle();
+
+ if (resourceMode == ApplyToFillMode) {
+ context->setAlphaAsFloat(svgStyle.fillOpacity());
+ context->setFillRule(svgStyle.fillRule());
+ } else {
+ context->setAlphaAsFloat(svgStyle.strokeOpacity());
+ applyStrokeStyleToContext(context, style, &renderer);
+ }
+ return true;
+}
+
void SVGRenderSupport::fillOrStrokePath(GraphicsContext* context, unsigned short resourceMode, const Path& path)
{
if (resourceMode & ApplyToFillMode)
« Source/core/rendering/svg/RenderSVGResource.h ('K') | « Source/core/rendering/svg/SVGRenderSupport.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698