Commit d80ab857 authored by fs@opera.com's avatar fs@opera.com

Move geometry generation out of RenderSVGResource*::postApplyResource

The code-paths that will operate on RenderSVGResources that are
paint-servers are quite easily distinguishable from those where other
resources are involved - and because all paint-servers have the same kind
of geometry generation it's trivially hoistable into the relevant
callsites.
This allows the argument list of postApplyResource to be shortened
(removing |path|, |shape| and |resourceMode| since they are now unused).
Since all callers of the hoisted function (fillOrStrokePrimitive) passes
either a |shape| or a |path| - but never both, we can split this method into
its two logical parts.
Doing this however reveal that the |shape| variant can be trivially folded
into it's callers since they will always end up calling the same method.
This means that fillOrStrokePrimitive is replaced with/transformed into
fillOrStrokePath.

Review URL: https://codereview.chromium.org/571923002

git-svn-id: svn://svn.chromium.org/blink/trunk@182004 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6e437302
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) = 0; virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) = 0;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) = 0; virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) = 0;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) { } virtual void postApplyResource(RenderObject*, GraphicsContext*&) { }
virtual RenderSVGResourceType resourceType() const = 0; virtual RenderSVGResourceType resourceType() const = 0;
......
...@@ -208,8 +208,8 @@ bool RenderSVGResourceClipper::applyClippingToContext(RenderObject* target, cons ...@@ -208,8 +208,8 @@ bool RenderSVGResourceClipper::applyClippingToContext(RenderObject* target, cons
return true; return true;
} }
void RenderSVGResourceClipper::postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, void RenderSVGResourceClipper::postApplyResource(RenderObject*, GraphicsContext*&)
const Path*, const RenderSVGShape*) { {
// Clippers are always applied using stateful methods. // Clippers are always applied using stateful methods.
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
} }
......
...@@ -44,7 +44,7 @@ public: ...@@ -44,7 +44,7 @@ public:
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE; virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE; virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) OVERRIDE; virtual void postApplyResource(RenderObject*, GraphicsContext*&) OVERRIDE;
// FIXME: Filters are also stateful resources that could benefit from having their state managed // FIXME: Filters are also stateful resources that could benefit from having their state managed
// on the caller stack instead of the current hashmap. We should look at refactoring these // on the caller stack instead of the current hashmap. We should look at refactoring these
......
...@@ -337,11 +337,10 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*, ...@@ -337,11 +337,10 @@ bool RenderSVGResourceFilter::applyResource(RenderObject* object, RenderStyle*,
return true; return true;
} }
void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsContext*& context, unsigned short resourceMode, const Path*, const RenderSVGShape*) void RenderSVGResourceFilter::postApplyResource(RenderObject* object, GraphicsContext*& context)
{ {
ASSERT(object); ASSERT(object);
ASSERT(context); ASSERT(context);
ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
FilterData* filterData = m_filter.get(object); FilterData* filterData = m_filter.get(object);
if (!filterData) if (!filterData)
......
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE; virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE; virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE; virtual void postApplyResource(RenderObject*, GraphicsContext*&) OVERRIDE;
FloatRect resourceBoundingBox(const RenderObject*); FloatRect resourceBoundingBox(const RenderObject*);
......
...@@ -128,11 +128,9 @@ bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle* ...@@ -128,11 +128,9 @@ bool RenderSVGResourceGradient::applyResource(RenderObject* object, RenderStyle*
return true; return true;
} }
void RenderSVGResourceGradient::postApplyResource(RenderObject*, GraphicsContext*& context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape) void RenderSVGResourceGradient::postApplyResource(RenderObject*, GraphicsContext*& context)
{ {
ASSERT(context); ASSERT(context);
SVGRenderSupport::fillOrStrokePrimitive(context, resourceMode, path, shape);
context->restore(); context->restore();
} }
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE FINAL; virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE FINAL;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE FINAL; virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE FINAL;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE FINAL; virtual void postApplyResource(RenderObject*, GraphicsContext*&) OVERRIDE FINAL;
protected: protected:
void addStops(GradientData*, const Vector<Gradient::ColorStop>&) const; void addStops(GradientData*, const Vector<Gradient::ColorStop>&) const;
......
...@@ -76,13 +76,11 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*, ...@@ -76,13 +76,11 @@ bool RenderSVGResourceMasker::applyResource(RenderObject* object, RenderStyle*,
return true; return true;
} }
void RenderSVGResourceMasker::postApplyResource(RenderObject* object, GraphicsContext*& context, void RenderSVGResourceMasker::postApplyResource(RenderObject* object, GraphicsContext*& context)
unsigned short resourceMode, const Path*, const RenderSVGShape*)
{ {
ASSERT(object); ASSERT(object);
ASSERT(context); ASSERT(context);
ASSERT(style()); ASSERT(style());
ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode);
ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout());
FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordinates(); FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordinates();
......
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
virtual void removeAllClientsFromCache(bool markForInvalidation = true) OVERRIDE; virtual void removeAllClientsFromCache(bool markForInvalidation = true) OVERRIDE;
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE; virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE; virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short, const Path*, const RenderSVGShape*) OVERRIDE; virtual void postApplyResource(RenderObject*, GraphicsContext*&) OVERRIDE;
FloatRect resourceBoundingBox(const RenderObject*); FloatRect resourceBoundingBox(const RenderObject*);
SVGUnitTypes::SVGUnitType maskUnits() const { return toSVGMaskElement(element())->maskUnits()->currentValue()->enumValue(); } SVGUnitTypes::SVGUnitType maskUnits() const { return toSVGMaskElement(element())->maskUnits()->currentValue()->enumValue(); }
......
...@@ -171,11 +171,9 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle* ...@@ -171,11 +171,9 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle*
return true; return true;
} }
void RenderSVGResourcePattern::postApplyResource(RenderObject*, GraphicsContext*& context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape) void RenderSVGResourcePattern::postApplyResource(RenderObject*, GraphicsContext*& context)
{ {
ASSERT(context); ASSERT(context);
SVGRenderSupport::fillOrStrokePrimitive(context, resourceMode, path, shape);
context->restore(); context->restore();
} }
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE; virtual void removeClientFromCache(RenderObject*, bool markForInvalidation = true) OVERRIDE;
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE; virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE; virtual void postApplyResource(RenderObject*, GraphicsContext*&) OVERRIDE;
virtual RenderSVGResourceType resourceType() const OVERRIDE { return s_resourceType; } virtual RenderSVGResourceType resourceType() const OVERRIDE { return s_resourceType; }
static const RenderSVGResourceType s_resourceType; static const RenderSVGResourceType s_resourceType;
......
...@@ -81,10 +81,4 @@ bool RenderSVGResourceSolidColor::applyResource(RenderObject* object, RenderStyl ...@@ -81,10 +81,4 @@ bool RenderSVGResourceSolidColor::applyResource(RenderObject* object, RenderStyl
return true; return true;
} }
void RenderSVGResourceSolidColor::postApplyResource(RenderObject*, GraphicsContext*& context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape)
{
ASSERT(context);
SVGRenderSupport::fillOrStrokePrimitive(context, resourceMode, path, shape);
}
} }
...@@ -35,7 +35,6 @@ public: ...@@ -35,7 +35,6 @@ public:
virtual void removeClientFromCache(RenderObject*, bool = true) OVERRIDE { } virtual void removeClientFromCache(RenderObject*, bool = true) OVERRIDE { }
virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE; virtual bool applyResource(RenderObject*, RenderStyle*, GraphicsContext*&, unsigned short resourceMode) OVERRIDE;
virtual void postApplyResource(RenderObject*, GraphicsContext*&, unsigned short resourceMode, const Path*, const RenderSVGShape*) OVERRIDE;
virtual RenderSVGResourceType resourceType() const OVERRIDE { return s_resourceType; } virtual RenderSVGResourceType resourceType() const OVERRIDE { return s_resourceType; }
static const RenderSVGResourceType s_resourceType; static const RenderSVGResourceType s_resourceType;
......
...@@ -205,11 +205,14 @@ void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context) ...@@ -205,11 +205,14 @@ void RenderSVGShape::fillShape(RenderStyle* style, GraphicsContext* context)
bool hasFallback; bool hasFallback;
if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style, hasFallback)) { if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style, hasFallback)) {
if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode)) { if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode)) {
fillPaintingResource->postApplyResource(this, context, ApplyToFillMode, 0, this); fillShape(context);
fillPaintingResource->postApplyResource(this, context);
} else if (hasFallback) { } else if (hasFallback) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource(); RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
if (fallbackResource->applyResource(this, style, context, ApplyToFillMode)) if (fallbackResource->applyResource(this, style, context, ApplyToFillMode)) {
fallbackResource->postApplyResource(this, context, ApplyToFillMode, 0, this); fillShape(context);
fallbackResource->postApplyResource(this, context);
}
} }
} }
} }
...@@ -219,11 +222,14 @@ void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context) ...@@ -219,11 +222,14 @@ void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context)
bool hasFallback; bool hasFallback;
if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(this, style, hasFallback)) { if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(this, style, hasFallback)) {
if (strokePaintingResource->applyResource(this, style, context, ApplyToStrokeMode)) { if (strokePaintingResource->applyResource(this, style, context, ApplyToStrokeMode)) {
strokePaintingResource->postApplyResource(this, context, ApplyToStrokeMode, 0, this); strokeShape(context);
strokePaintingResource->postApplyResource(this, context);
} else if (hasFallback) { } else if (hasFallback) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource(); RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
if (fallbackResource->applyResource(this, style, context, ApplyToStrokeMode)) if (fallbackResource->applyResource(this, style, context, ApplyToStrokeMode)) {
fallbackResource->postApplyResource(this, context, ApplyToStrokeMode, 0, this); strokeShape(context);
fallbackResource->postApplyResource(this, context);
}
} }
} }
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "core/rendering/svg/RenderSVGInlineText.h" #include "core/rendering/svg/RenderSVGInlineText.h"
#include "core/rendering/svg/RenderSVGResource.h" #include "core/rendering/svg/RenderSVGResource.h"
#include "core/rendering/svg/RenderSVGResourceSolidColor.h" #include "core/rendering/svg/RenderSVGResourceSolidColor.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/rendering/svg/SVGResourcesCache.h" #include "core/rendering/svg/SVGResourcesCache.h"
#include "core/rendering/svg/SVGTextRunRenderingContext.h" #include "core/rendering/svg/SVGTextRunRenderingContext.h"
#include "platform/FloatConversion.h" #include "platform/FloatConversion.h"
...@@ -353,7 +354,7 @@ public: ...@@ -353,7 +354,7 @@ public:
~PaintingResourceScope() { ASSERT(!m_paintingResource); } ~PaintingResourceScope() { ASSERT(!m_paintingResource); }
bool acquirePaintingResource(GraphicsContext*&, float scalingFactor, RenderStyle*, RenderSVGResourceModeFlags); bool acquirePaintingResource(GraphicsContext*&, float scalingFactor, RenderStyle*, RenderSVGResourceModeFlags);
void releasePaintingResource(GraphicsContext*&, const Path*, RenderSVGResourceModeFlags); void releasePaintingResource(GraphicsContext*&);
private: private:
RenderObject& m_renderer; RenderObject& m_renderer;
...@@ -401,12 +402,11 @@ bool PaintingResourceScope::acquirePaintingResource(GraphicsContext*& context, f ...@@ -401,12 +402,11 @@ bool PaintingResourceScope::acquirePaintingResource(GraphicsContext*& context, f
return true; return true;
} }
void PaintingResourceScope::releasePaintingResource(GraphicsContext*& context, const Path* path, void PaintingResourceScope::releasePaintingResource(GraphicsContext*& context)
RenderSVGResourceModeFlags resourceMode)
{ {
ASSERT(m_paintingResource); ASSERT(m_paintingResource);
m_paintingResource->postApplyResource(&m_renderer, context, resourceMode, path, 0); m_paintingResource->postApplyResource(&m_renderer, context);
m_paintingResource = 0; m_paintingResource = 0;
#if ENABLE(SVG_FONTS) #if ENABLE(SVG_FONTS)
...@@ -590,8 +590,10 @@ void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, TextDe ...@@ -590,8 +590,10 @@ void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, TextDe
// acquirePaintingResource also modifies state if the scalingFactor is non-identity. // acquirePaintingResource also modifies state if the scalingFactor is non-identity.
// Above we have saved the state for this case. // Above we have saved the state for this case.
PaintingResourceScope resourceScope(*decorationRenderer); PaintingResourceScope resourceScope(*decorationRenderer);
if (resourceScope.acquirePaintingResource(context, scalingFactor, decorationStyle, resourceMode)) if (resourceScope.acquirePaintingResource(context, scalingFactor, decorationStyle, resourceMode)) {
resourceScope.releasePaintingResource(context, &path, resourceMode); SVGRenderSupport::fillOrStrokePath(context, resourceMode, path);
resourceScope.releasePaintingResource(context);
}
} }
void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyle* style, void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyle* style,
...@@ -633,7 +635,7 @@ void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyl ...@@ -633,7 +635,7 @@ void SVGInlineTextBox::paintTextWithShadows(GraphicsContext* context, RenderStyl
textSize.width(), textSize.height()); textSize.width(), textSize.height());
scaledFont.drawText(context, textRunPaintInfo, textOrigin); scaledFont.drawText(context, textRunPaintInfo, textOrigin);
resourceScope.releasePaintingResource(context, 0, resourceMode); resourceScope.releasePaintingResource(context);
} }
if (scalingFactor != 1) if (scalingFactor != 1)
......
...@@ -365,22 +365,14 @@ void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, cons ...@@ -365,22 +365,14 @@ void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, cons
strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(lengthContext)); strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(lengthContext));
} }
void SVGRenderSupport::fillOrStrokePrimitive(GraphicsContext* context, unsigned short resourceMode, const Path* path, const RenderSVGShape* shape) void SVGRenderSupport::fillOrStrokePath(GraphicsContext* context, unsigned short resourceMode, const Path& path)
{ {
ASSERT(resourceMode != ApplyToDefaultMode); ASSERT(resourceMode != ApplyToDefaultMode);
if (resourceMode & ApplyToFillMode) { if (resourceMode & ApplyToFillMode)
if (path) context->fillPath(path);
context->fillPath(*path); if (resourceMode & ApplyToStrokeMode)
else if (shape) context->strokePath(path);
shape->fillShape(context);
}
if (resourceMode & ApplyToStrokeMode) {
if (path)
context->strokePath(*path);
else if (shape)
shape->strokeShape(context);
}
} }
bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object)
......
...@@ -82,8 +82,8 @@ public: ...@@ -82,8 +82,8 @@ public:
static void applyStrokeStyleToContext(GraphicsContext*, const RenderStyle*, const RenderObject*); static void applyStrokeStyleToContext(GraphicsContext*, const RenderStyle*, const RenderObject*);
static void applyStrokeStyleToStrokeData(StrokeData*, const RenderStyle*, const RenderObject*); static void applyStrokeStyleToStrokeData(StrokeData*, const RenderStyle*, const RenderObject*);
// Fill and/or stroke the primitive provide as either |path| or |shape|. The former has precedence if both are non-zero. // Fill and/or stroke the provided |path|.
static void fillOrStrokePrimitive(GraphicsContext*, unsigned short resourceMode, const Path*, const RenderSVGShape*); static void fillOrStrokePath(GraphicsContext*, unsigned short resourceMode, const Path&);
// Determines if any ancestor's transform has changed. // Determines if any ancestor's transform has changed.
static bool transformToRootChanged(RenderObject*); static bool transformToRootChanged(RenderObject*);
......
...@@ -63,7 +63,7 @@ SVGRenderingContext::~SVGRenderingContext() ...@@ -63,7 +63,7 @@ SVGRenderingContext::~SVGRenderingContext()
if (m_filter) { if (m_filter) {
ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->filter() == m_filter); ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->filter() == m_filter);
m_filter->postApplyResource(m_object, m_paintInfo->context, ApplyToDefaultMode, 0, 0); m_filter->postApplyResource(m_object, m_paintInfo->context);
m_paintInfo->context = m_savedContext; m_paintInfo->context = m_savedContext;
m_paintInfo->rect = m_savedPaintRect; m_paintInfo->rect = m_savedPaintRect;
} }
...@@ -75,7 +75,7 @@ SVGRenderingContext::~SVGRenderingContext() ...@@ -75,7 +75,7 @@ SVGRenderingContext::~SVGRenderingContext()
if (m_masker) { if (m_masker) {
ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->masker() == m_masker); ASSERT(SVGResourcesCache::cachedResourcesForRenderObject(m_object)->masker() == m_masker);
m_masker->postApplyResource(m_object, m_paintInfo->context, ApplyToDefaultMode, 0, 0); m_masker->postApplyResource(m_object, m_paintInfo->context);
} }
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "core/rendering/RenderObject.h" #include "core/rendering/RenderObject.h"
#include "core/rendering/svg/RenderSVGInlineText.h" #include "core/rendering/svg/RenderSVGInlineText.h"
#include "core/rendering/svg/RenderSVGResourceSolidColor.h" #include "core/rendering/svg/RenderSVGResourceSolidColor.h"
#include "core/rendering/svg/SVGRenderSupport.h"
#include "core/svg/SVGFontData.h" #include "core/svg/SVGFontData.h"
#include "core/svg/SVGFontElement.h" #include "core/svg/SVGFontElement.h"
#include "core/svg/SVGFontFaceElement.h" #include "core/svg/SVGFontFaceElement.h"
...@@ -164,7 +165,8 @@ void SVGTextRunRenderingContext::drawSVGGlyphs(GraphicsContext* context, const T ...@@ -164,7 +165,8 @@ void SVGTextRunRenderingContext::drawSVGGlyphs(GraphicsContext* context, const T
float strokeThickness = context->strokeThickness(); float strokeThickness = context->strokeThickness();
if (renderObject && renderObject->isSVGInlineText()) if (renderObject && renderObject->isSVGInlineText())
context->setStrokeThickness(strokeThickness * toRenderSVGInlineText(renderObject)->scalingFactor()); context->setStrokeThickness(strokeThickness * toRenderSVGInlineText(renderObject)->scalingFactor());
activePaintingResource->postApplyResource(parentRenderObject, context, resourceMode, &glyphPath, 0); SVGRenderSupport::fillOrStrokePath(context, resourceMode, glyphPath);
activePaintingResource->postApplyResource(parentRenderObject, context);
context->setStrokeThickness(strokeThickness); context->setStrokeThickness(strokeThickness);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment