Index: Source/core/rendering/svg/RenderSVGResource.cpp |
diff --git a/Source/core/rendering/svg/RenderSVGResource.cpp b/Source/core/rendering/svg/RenderSVGResource.cpp |
index 517a57c17dbb15e772d34337c8cef38987c73c77..c61a80ee5d2e1a4ba28b66a5c6eefc26fa022fd5 100644 |
--- a/Source/core/rendering/svg/RenderSVGResource.cpp |
+++ b/Source/core/rendering/svg/RenderSVGResource.cpp |
@@ -21,24 +21,22 @@ |
*/ |
#include "config.h" |
- |
#include "core/rendering/svg/RenderSVGResource.h" |
+#include "core/paint/SVGPaintServer.h" |
#include "core/rendering/svg/RenderSVGResourceClipper.h" |
#include "core/rendering/svg/RenderSVGResourceFilter.h" |
#include "core/rendering/svg/RenderSVGResourceMasker.h" |
#include "core/rendering/svg/RenderSVGResourceSolidColor.h" |
-#include "core/rendering/svg/SVGRenderSupport.h" |
#include "core/rendering/svg/SVGResources.h" |
#include "core/rendering/svg/SVGResourcesCache.h" |
-#include "platform/graphics/GraphicsContext.h" |
namespace blink { |
-bool RenderSVGResource::applyResource(RenderObject*, RenderStyle*, GraphicsContext*, RenderSVGResourceModeFlags) |
+PassOwnPtr<SVGPaintServer> RenderSVGResource::preparePaintServer(RenderObject*, RenderStyle*, RenderSVGResourceModeFlags) |
{ |
ASSERT_NOT_REACHED(); |
- return false; |
+ return nullptr; |
} |
RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, bool& hasFallback) |
@@ -51,21 +49,12 @@ RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceM |
// If we have no style at all, ignore it. |
const SVGRenderStyle& svgStyle = style->svgStyle(); |
- bool isRenderingMask = SVGRenderSupport::isRenderingClipPathAsMaskImage(*object); |
- |
// If we have no fill/stroke, return 0. |
if (mode == ApplyToFillMode) { |
- // When rendering the mask for a RenderSVGResourceClipper, always use the initial fill paint server, and ignore stroke. |
- if (isRenderingMask) { |
- RenderSVGResourceSolidColor* colorResource = RenderSVGResource::sharedSolidPaintingResource(); |
- colorResource->setColor(SVGRenderStyle::initialFillPaintColor()); |
- return colorResource; |
- } |
- |
if (!svgStyle.hasFill()) |
return 0; |
} else { |
- if (!svgStyle.hasStroke() || isRenderingMask) |
+ if (!svgStyle.hasStroke()) |
return 0; |
} |
@@ -130,32 +119,6 @@ RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceM |
return uriResource; |
} |
-void RenderSVGResource::updateGraphicsContext(GraphicsContext* context, const RenderStyle* style, const RenderObject& renderer, unsigned resourceModeFlags) |
-{ |
- ASSERT(context); |
- ASSERT(style); |
- |
- RenderSVGResourceMode resourceMode = static_cast<RenderSVGResourceMode>(resourceModeFlags & (ApplyToFillMode | ApplyToStrokeMode)); |
- ASSERT(resourceMode == ApplyToFillMode || resourceMode == ApplyToStrokeMode); |
- |
- if (SVGRenderSupport::isRenderingClipPathAsMaskImage(renderer)) { |
- // When rendering the mask for a RenderSVGResourceClipper, the stroke code path is never hit. |
- ASSERT(resourceMode == ApplyToFillMode); |
- context->setAlphaAsFloat(1); |
- return; |
- } |
- |
- const SVGRenderStyle& svgStyle = style->svgStyle(); |
- |
- if (resourceMode == ApplyToFillMode) { |
- context->setAlphaAsFloat(svgStyle.fillOpacity()); |
- context->setFillRule(svgStyle.fillRule()); |
- } else { |
- context->setAlphaAsFloat(svgStyle.strokeOpacity()); |
- SVGRenderSupport::applyStrokeStyleToContext(context, style, &renderer); |
- } |
-} |
- |
RenderSVGResourceSolidColor* RenderSVGResource::sharedSolidPaintingResource() |
{ |
static RenderSVGResourceSolidColor* s_sharedSolidPaintingResource = 0; |