Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: Source/core/rendering/svg/SVGRenderSupport.cpp

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert aggressive svgAttributeChanged, add NeedsRebaseline Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/svg/SVGPathData.cpp ('k') | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGRenderSupport.cpp
diff --git a/Source/core/rendering/svg/SVGRenderSupport.cpp b/Source/core/rendering/svg/SVGRenderSupport.cpp
index cfc4a641f7f647a07a4c9f39b7c614919bd3e486..99871c7b9142b52b5a8a6b59b4f5d26958c7adba 100644
--- a/Source/core/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/core/rendering/svg/SVGRenderSupport.cpp
@@ -357,21 +357,22 @@ void SVGRenderSupport::applyStrokeStyleToContext(GraphicsContext* context, const
ASSERT(svgStyle);
SVGLengthContext lengthContext(toSVGElement(object->node()));
- context->setStrokeThickness(svgStyle->strokeWidth().value(lengthContext));
+ context->setStrokeThickness(svgStyle->strokeWidth()->value(lengthContext));
context->setLineCap(svgStyle->capStyle());
context->setLineJoin(svgStyle->joinStyle());
context->setMiterLimit(svgStyle->strokeMiterLimit());
- const Vector<SVGLength>& dashes = svgStyle->strokeDashArray();
- if (dashes.isEmpty())
+ RefPtr<SVGLengthList> dashes = svgStyle->strokeDashArray();
+ if (dashes->isEmpty())
return;
DashArray dashArray;
- const Vector<SVGLength>::const_iterator end = dashes.end();
- for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it)
- dashArray.append((*it).value(lengthContext));
+ SVGLengthList::ConstIterator it = dashes->begin();
+ SVGLengthList::ConstIterator itEnd = dashes->end();
+ for (; it != itEnd; ++it)
+ dashArray.append(it->value(lengthContext));
- context->setLineDash(dashArray, svgStyle->strokeDashOffset().value(lengthContext));
+ context->setLineDash(dashArray, svgStyle->strokeDashOffset()->value(lengthContext));
}
void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, const RenderStyle* style, const RenderObject* object)
@@ -386,21 +387,21 @@ void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, cons
ASSERT(svgStyle);
SVGLengthContext lengthContext(toSVGElement(object->node()));
- strokeData->setThickness(svgStyle->strokeWidth().value(lengthContext));
+ strokeData->setThickness(svgStyle->strokeWidth()->value(lengthContext));
strokeData->setLineCap(svgStyle->capStyle());
strokeData->setLineJoin(svgStyle->joinStyle());
strokeData->setMiterLimit(svgStyle->strokeMiterLimit());
- const Vector<SVGLength>& dashes = svgStyle->strokeDashArray();
- if (dashes.isEmpty())
+ RefPtr<SVGLengthList> dashes = svgStyle->strokeDashArray();
+ if (dashes->isEmpty())
return;
DashArray dashArray;
- const Vector<SVGLength>::const_iterator end = dashes.end();
- for (Vector<SVGLength>::const_iterator it = dashes.begin(); it != end; ++it)
- dashArray.append((*it).value(lengthContext));
+ size_t length = dashes->numberOfItems();
+ for (size_t i = 0; i < length; ++i)
+ dashArray.append(dashes->at(i)->value(lengthContext));
- strokeData->setLineDash(dashArray, svgStyle->strokeDashOffset().value(lengthContext));
+ strokeData->setLineDash(dashArray, svgStyle->strokeDashOffset()->value(lengthContext));
}
bool SVGRenderSupport::isEmptySVGInlineText(const RenderObject* object)
« no previous file with comments | « Source/core/rendering/svg/SVGPathData.cpp ('k') | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698