summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/svg
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-01-05 12:15:11 +0000
committerSteve Block <steveblock@google.com>2011-01-06 14:14:00 +0000
commitd06194330da2bb8da887d2e1adeacb3a5c1504b2 (patch)
treee0af8413af65a8e30630563441af7bdb8478e513 /WebCore/rendering/svg
parent419a5cf2f8db6ca014df624865197ffb82caad37 (diff)
downloadexternal_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.zip
external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.gz
external_webkit-d06194330da2bb8da887d2e1adeacb3a5c1504b2.tar.bz2
Merge WebKit at r72805: Initial merge by Git
Note that this is a backwards merge from Chromium release 9.0.600.0 to 9.0.597.0, to align with the Chromium 9 stable release branch. Change-Id: I5d2bb4e8cee9d39ae8485abf48bdb55ecf8b3790
Diffstat (limited to 'WebCore/rendering/svg')
-rw-r--r--WebCore/rendering/svg/RenderSVGPath.cpp23
-rw-r--r--WebCore/rendering/svg/SVGInlineTextBox.cpp10
-rw-r--r--WebCore/rendering/svg/SVGInlineTextBox.h2
3 files changed, 19 insertions, 16 deletions
diff --git a/WebCore/rendering/svg/RenderSVGPath.cpp b/WebCore/rendering/svg/RenderSVGPath.cpp
index 0c8ac0c..483303f 100644
--- a/WebCore/rendering/svg/RenderSVGPath.cpp
+++ b/WebCore/rendering/svg/RenderSVGPath.cpp
@@ -148,17 +148,19 @@ void RenderSVGPath::layout()
void RenderSVGPath::fillAndStrokePath(GraphicsContext* context)
{
+ context->beginPath();
RenderStyle* style = this->style();
Color fallbackColor;
if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style, fallbackColor)) {
+ context->addPath(m_path);
if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode))
- fillPaintingResource->postApplyResource(this, context, ApplyToFillMode, &m_path);
+ fillPaintingResource->postApplyResource(this, context, ApplyToFillMode);
else if (fallbackColor.isValid()) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
fallbackResource->setColor(fallbackColor);
if (fallbackResource->applyResource(this, style, context, ApplyToFillMode))
- fallbackResource->postApplyResource(this, context, ApplyToFillMode, &m_path);
+ fallbackResource->postApplyResource(this, context, ApplyToFillMode);
}
}
@@ -167,31 +169,30 @@ void RenderSVGPath::fillAndStrokePath(GraphicsContext* context)
if (!strokePaintingResource)
return;
- Path path;
-
- bool nonScalingStroke = style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE;
bool restoreContext = false;
- if (nonScalingStroke) {
+ if (style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE) {
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
AffineTransform nonScalingStrokeTransform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate);
if (!nonScalingStrokeTransform.isInvertible())
return;
- path = m_path;
- path.transform(nonScalingStrokeTransform);
+ Path transformedPath = m_path;
+ transformedPath.transform(nonScalingStrokeTransform);
context->save();
context->concatCTM(nonScalingStrokeTransform.inverse());
+ context->addPath(transformedPath);
restoreContext = true;
- }
+ } else
+ context->addPath(m_path);
if (strokePaintingResource->applyResource(this, style, context, ApplyToStrokeMode))
- strokePaintingResource->postApplyResource(this, context, ApplyToStrokeMode, nonScalingStroke ? &path : &m_path);
+ strokePaintingResource->postApplyResource(this, context, ApplyToStrokeMode);
else if (fallbackColor.isValid()) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
fallbackResource->setColor(fallbackColor);
if (fallbackResource->applyResource(this, style, context, ApplyToStrokeMode))
- fallbackResource->postApplyResource(this, context, ApplyToStrokeMode, nonScalingStroke ? &path : &m_path);
+ fallbackResource->postApplyResource(this, context, ApplyToStrokeMode);
}
if (restoreContext)
diff --git a/WebCore/rendering/svg/SVGInlineTextBox.cpp b/WebCore/rendering/svg/SVGInlineTextBox.cpp
index 5d0278b..d1f660a 100644
--- a/WebCore/rendering/svg/SVGInlineTextBox.cpp
+++ b/WebCore/rendering/svg/SVGInlineTextBox.cpp
@@ -318,14 +318,14 @@ bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, Render
return true;
}
-void SVGInlineTextBox::releasePaintingResource(GraphicsContext*& context, const Path* path)
+void SVGInlineTextBox::releasePaintingResource(GraphicsContext*& context)
{
ASSERT(m_paintingResource);
RenderObject* parentRenderer = parent()->renderer();
ASSERT(parentRenderer);
- m_paintingResource->postApplyResource(parentRenderer, context, m_paintingResourceMode, path);
+ m_paintingResource->postApplyResource(parentRenderer, context, m_paintingResourceMode);
m_paintingResource = 0;
}
@@ -344,7 +344,7 @@ bool SVGInlineTextBox::prepareGraphicsContextForTextPainting(GraphicsContext*& c
void SVGInlineTextBox::restoreGraphicsContextAfterTextPainting(GraphicsContext*& context, TextRun& textRun)
{
- releasePaintingResource(context, /* path */0);
+ releasePaintingResource(context);
#if ENABLE(SVG_FONTS)
textRun.setActivePaintingResource(0);
@@ -500,9 +500,11 @@ void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, ETextD
path.addRect(FloatRect(fragment.x, y, fragment.width, thickness));
context->save();
+ context->beginPath();
+ context->addPath(path);
if (acquirePaintingResource(context, decorationRenderer, decorationStyle))
- releasePaintingResource(context, &path);
+ releasePaintingResource(context);
context->restore();
}
diff --git a/WebCore/rendering/svg/SVGInlineTextBox.h b/WebCore/rendering/svg/SVGInlineTextBox.h
index acc5e9f..8e82dda 100644
--- a/WebCore/rendering/svg/SVGInlineTextBox.h
+++ b/WebCore/rendering/svg/SVGInlineTextBox.h
@@ -68,7 +68,7 @@ private:
TextRun constructTextRun(RenderStyle*, const SVGTextFragment&) const;
bool acquirePaintingResource(GraphicsContext*&, RenderObject*, RenderStyle*);
- void releasePaintingResource(GraphicsContext*&, const Path*);
+ void releasePaintingResource(GraphicsContext*&);
bool prepareGraphicsContextForTextPainting(GraphicsContext*&, TextRun&, RenderStyle*);
void restoreGraphicsContextAfterTextPainting(GraphicsContext*&, TextRun&);