Index: Source/core/rendering/svg/RenderSVGResourceGradient.cpp |
diff --git a/Source/core/rendering/svg/RenderSVGResourceGradient.cpp b/Source/core/rendering/svg/RenderSVGResourceGradient.cpp |
index d1a3363ab40d9043c3be3731beb672ac421c6559..01d316f4408112ae697c79de25b31c06815d3721 100644 |
--- a/Source/core/rendering/svg/RenderSVGResourceGradient.cpp |
+++ b/Source/core/rendering/svg/RenderSVGResourceGradient.cpp |
@@ -21,12 +21,9 @@ |
*/ |
#include "config.h" |
- |
#include "core/rendering/svg/RenderSVGResourceGradient.h" |
-#include "core/rendering/svg/RenderSVGShape.h" |
-#include "core/rendering/svg/SVGRenderSupport.h" |
-#include "platform/graphics/GraphicsContext.h" |
+#include "core/paint/SVGPaintServer.h" |
namespace blink { |
@@ -50,11 +47,10 @@ void RenderSVGResourceGradient::removeClientFromCache(RenderObject* client, bool |
markClientForInvalidation(client, markForInvalidation ? PaintInvalidation : ParentOnlyInvalidation); |
} |
-bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle* style, GraphicsContext* context, RenderSVGResourceModeFlags resourceMode) |
+bool RenderSVGResourceGradient::preparePaintServer(RenderObject* object, RenderStyle* style, RenderSVGResourceModeFlags resourceMode, SVGPaintServer& paintServer) |
{ |
ASSERT(object); |
ASSERT(style); |
- ASSERT(context); |
clearInvalidationMask(); |
@@ -108,24 +104,10 @@ bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle* |
AffineTransform computedGradientSpaceTransform = computeResourceSpaceTransform(object, gradientData->userspaceTransform, svgStyle, resourceMode); |
gradientData->gradient->setGradientSpaceTransform(computedGradientSpaceTransform); |
- // Draw gradient |
- context->save(); |
- |
- if (resourceMode & ApplyToFillMode) |
- context->setFillGradient(gradientData->gradient); |
- else if (resourceMode & ApplyToStrokeMode) |
- context->setStrokeGradient(gradientData->gradient); |
- |
- updateGraphicsContext(context, style, *object, resourceMode); |
+ paintServer.setGradient(gradientData->gradient); |
return true; |
} |
-void RenderSVGResourceGradient::postApplyResource(GraphicsContext* context) |
-{ |
- ASSERT(context); |
- context->restore(); |
-} |
- |
void RenderSVGResourceGradient::addStops(GradientData* gradientData, const Vector<Gradient::ColorStop>& stops) const |
{ |
ASSERT(gradientData->gradient); |