| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/PathSVGInterpolation.h" | 6 #include "core/animation/PathSVGInterpolation.h" |
| 7 | 7 |
| 8 #include "core/svg/SVGPathByteStreamBuilder.h" | 8 #include "core/svg/SVGPathByteStreamBuilder.h" |
| 9 #include "core/svg/SVGPathByteStreamSource.h" | 9 #include "core/svg/SVGPathByteStreamSource.h" |
| 10 #include "core/svg/SVGPathElement.h" | 10 #include "core/svg/SVGPathElement.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 ++i; | 426 ++i; |
| 427 } | 427 } |
| 428 ASSERT(!endPathSource.hasMoreData()); | 428 ASSERT(!endPathSource.hasMoreData()); |
| 429 ASSERT(i == length); | 429 ASSERT(i == length); |
| 430 | 430 |
| 431 return adoptRef(new PathSVGInterpolation(startValue.release(), endValue.rele
ase(), attribute, pathSegTypes)); | 431 return adoptRef(new PathSVGInterpolation(startValue.release(), endValue.rele
ase(), attribute, pathSegTypes)); |
| 432 } | 432 } |
| 433 | 433 |
| 434 PassRefPtrWillBeRawPtr<SVGPropertyBase> PathSVGInterpolation::fromInterpolableVa
lue(const InterpolableValue& value, const Vector<SVGPathSegType>& pathSegTypes) | 434 PassRefPtrWillBeRawPtr<SVGPropertyBase> PathSVGInterpolation::fromInterpolableVa
lue(const InterpolableValue& value, const Vector<SVGPathSegType>& pathSegTypes) |
| 435 { | 435 { |
| 436 RefPtrWillBeRawPtr<SVGPath> result = SVGPath::create(); | 436 OwnPtr<SVGPathByteStream> pathByteStream = SVGPathByteStream::create(); |
| 437 InterpolatedPathSource source(toInterpolableList(value), pathSegTypes); | 437 InterpolatedPathSource source(toInterpolableList(value), pathSegTypes); |
| 438 SVGPathByteStreamBuilder builder(result->mutableByteStream()); | 438 SVGPathByteStreamBuilder builder(*pathByteStream); |
| 439 SVGPathParser parser(&source, &builder); | 439 SVGPathParser parser(&source, &builder); |
| 440 parser.parsePathDataFromSource(UnalteredParsing, false); | 440 parser.parsePathDataFromSource(UnalteredParsing, false); |
| 441 return result.release(); | 441 return SVGPath::create(pathByteStream.release()); |
| 442 } | 442 } |
| 443 | 443 |
| 444 PassRefPtrWillBeRawPtr<SVGPropertyBase> PathSVGInterpolation::interpolatedValue(
SVGElement&) const | 444 PassRefPtrWillBeRawPtr<SVGPropertyBase> PathSVGInterpolation::interpolatedValue(
SVGElement&) const |
| 445 { | 445 { |
| 446 return fromInterpolableValue(*m_cachedValue, m_pathSegTypes); | 446 return fromInterpolableValue(*m_cachedValue, m_pathSegTypes); |
| 447 } | 447 } |
| 448 | 448 |
| 449 } | 449 } |
| OLD | NEW |