diff options
Diffstat (limited to 'WebCore/svg/SVGFont.cpp')
-rw-r--r-- | WebCore/svg/SVGFont.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/WebCore/svg/SVGFont.cpp b/WebCore/svg/SVGFont.cpp index dacbac2..049d35e 100644 --- a/WebCore/svg/SVGFont.cpp +++ b/WebCore/svg/SVGFont.cpp @@ -27,6 +27,7 @@ #include "CSSFontSelector.h" #include "GraphicsContext.h" #include "RenderObject.h" +#include "RenderSVGResourceSolidColor.h" #include "SimpleFontData.h" #include "SVGAltGlyphElement.h" #include "SVGFontData.h" @@ -35,8 +36,6 @@ #include "SVGFontElement.h" #include "SVGFontFaceElement.h" #include "SVGMissingGlyphElement.h" -#include "SVGPaintServer.h" -#include "SVGPaintServerSolid.h" #include "XMLNames.h" using namespace WTF::Unicode; @@ -471,20 +470,20 @@ void Font::drawTextUsingSVGFont(GraphicsContext* context, const TextRun& run, FloatPoint currentPoint = point; float scale = convertEmUnitToPixel(size(), fontFaceElement->unitsPerEm(), 1.0f); - SVGPaintServer* activePaintServer = run.activePaintServer(); + RenderSVGResource* activePaintingResource = run.activePaintingResource(); // If renderObject is not set, we're dealing for HTML text rendered using SVG Fonts. if (!run.referencingRenderObject()) { - ASSERT(!activePaintServer); + ASSERT(!activePaintingResource); // TODO: We're only supporting simple filled HTML text so far. - SVGPaintServerSolid* solidPaintServer = SVGPaintServer::sharedSolidPaintServer(); - solidPaintServer->setColor(context->fillColor()); + RenderSVGResourceSolidColor* solidPaintingResource = RenderSVGResource::sharedSolidPaintingResource(); + solidPaintingResource->setColor(context->fillColor()); - activePaintServer = solidPaintServer; + activePaintingResource = solidPaintingResource; } - ASSERT(activePaintServer); + ASSERT(activePaintingResource); int charsConsumed; String glyphName; @@ -513,7 +512,7 @@ void Font::drawTextUsingSVGFont(GraphicsContext* context, const TextRun& run, SVGTextRunWalker<SVGTextRunWalkerDrawTextData> runWalker(fontData, fontElement, data, drawTextUsingSVGFontCallback, drawTextMissingGlyphCallback); runWalker.walk(run, isVerticalText, language, from, to); - SVGPaintTargetType targetType = context->textDrawingMode() == cTextStroke ? ApplyToStrokeTargetType : ApplyToFillTargetType; + RenderSVGResourceMode resourceMode = context->textDrawingMode() == cTextStroke ? ApplyToStrokeMode : ApplyToFillMode; unsigned numGlyphs = data.glyphIdentifiers.size(); unsigned fallbackCharacterIndex = 0; @@ -538,10 +537,10 @@ void Font::drawTextUsingSVGFont(GraphicsContext* context, const TextRun& run, context->beginPath(); context->addPath(glyphPath); - if (activePaintServer->setup(context, run.referencingRenderObject(), targetType)) { - activePaintServer->renderPath(context, run.referencingRenderObject(), targetType); - activePaintServer->teardown(context, run.referencingRenderObject(), targetType); - } + + RenderStyle* style = run.referencingRenderObject() ? run.referencingRenderObject()->style() : 0; + if (activePaintingResource->applyResource(run.referencingRenderObject(), style, context, resourceMode)) + activePaintingResource->postApplyResource(run.referencingRenderObject(), context, resourceMode); context->restore(); } |