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

Unified Diff: Source/core/animation/AnimatableStrokeDasharrayList.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
Index: Source/core/animation/AnimatableStrokeDasharrayList.cpp
diff --git a/Source/core/animation/AnimatableStrokeDasharrayList.cpp b/Source/core/animation/AnimatableStrokeDasharrayList.cpp
index 1b6f55c0e48a4972c4397f5222ca23e2dc7a1b75..47ea8af8564da97adb04680ecf28c78db77af4a7 100644
--- a/Source/core/animation/AnimatableStrokeDasharrayList.cpp
+++ b/Source/core/animation/AnimatableStrokeDasharrayList.cpp
@@ -36,21 +36,25 @@
namespace WebCore {
-AnimatableStrokeDasharrayList::AnimatableStrokeDasharrayList(const Vector<SVGLength>& lengths)
+AnimatableStrokeDasharrayList::AnimatableStrokeDasharrayList(PassRefPtr<SVGLengthList> passLengths)
{
- for (size_t i = 0; i < lengths.size(); ++i)
- m_values.append(AnimatableSVGLength::create(lengths[i]));
+ RefPtr<SVGLengthList> lengths = passLengths;
+ SVGLengthList::ConstIterator it = lengths->begin();
+ SVGLengthList::ConstIterator itEnd = lengths->end();
+ for (; it != itEnd; ++it)
+ m_values.append(AnimatableSVGLength::create(*it));
}
-Vector<SVGLength> AnimatableStrokeDasharrayList::toSVGLengthVector() const
+PassRefPtr<SVGLengthList> AnimatableStrokeDasharrayList::toSVGLengthList() const
{
- Vector<SVGLength> lengths(m_values.size());
+ RefPtr<SVGLengthList> lengths = SVGLengthList::create();
for (size_t i = 0; i < m_values.size(); ++i) {
- lengths[i] = toAnimatableSVGLength(m_values[i].get())->toSVGLength();
- if (lengths[i].valueInSpecifiedUnits() < 0)
- lengths[i].setValueInSpecifiedUnits(0);
+ RefPtr<SVGLength> length = toAnimatableSVGLength(m_values[i].get())->toSVGLength();
+ if (length->valueInSpecifiedUnits() < 0)
+ length->setValueInSpecifiedUnits(0);
+ lengths->append(length);
}
- return lengths;
+ return lengths.release();
}
bool AnimatableStrokeDasharrayList::usesDefaultInterpolationWith(const AnimatableValue* value) const
@@ -71,7 +75,7 @@ PassRefPtr<AnimatableValue> AnimatableStrokeDasharrayList::interpolateTo(const A
if (from.isEmpty() && to.isEmpty())
return takeConstRef(this);
if (from.isEmpty() || to.isEmpty()) {
- DEFINE_STATIC_REF(AnimatableSVGLength, zeroPixels, AnimatableSVGLength::create(SVGLength()).leakRef());
+ DEFINE_STATIC_REF(AnimatableSVGLength, zeroPixels, AnimatableSVGLength::create(SVGLength::create()).leakRef());
if (from.isEmpty()) {
from.append(zeroPixels);
from.append(zeroPixels);
« no previous file with comments | « Source/core/animation/AnimatableStrokeDasharrayList.h ('k') | Source/core/animation/AnimatableStrokeDasharrayListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698