PassOwnPtr<SVGAnimatedType> SVGAnimatedPathAnimator::startAnimValAnimation(const Vector<SVGAnimatedProperty*>& properties) { ASSERT(properties.size() == 1); SVGAnimatedPathSegListPropertyTearOff* property = castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(properties[0]); const SVGPathSegList& baseValue = property->currentBaseValue(); // Build initial path byte stream. OwnPtr<SVGPathByteStream> byteStream = SVGPathByteStream::create(); SVGPathParserFactory::self()->buildSVGPathByteStreamFromSVGPathSegList(baseValue, byteStream.get(), UnalteredParsing); Vector<SVGAnimatedPathSegListPropertyTearOff*> result; result.append(property); SVGElementInstance::InstanceUpdateBlocker blocker(property->contextElement()); collectAnimatedPropertiesFromInstances(result, 0, property->contextElement(), property->attributeName()); size_t resultSize = result.size(); for (size_t i = 0; i < resultSize; ++i) result[i]->animationStarted(byteStream.get(), &baseValue); return SVGAnimatedType::createPath(byteStream.release()); }
PassOwnPtr<SVGAnimatedType> SVGAnimatedPathAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) { ASSERT(animatedTypes.size() >= 1); SVGAnimatedPathSegListPropertyTearOff* property = castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(animatedTypes[0].properties[0].get()); const SVGPathSegList& baseValue = property->currentBaseValue(); // Build initial path byte stream. OwnPtr<SVGPathByteStream> byteStream = SVGPathByteStream::create(); buildSVGPathByteStreamFromSVGPathSegList(baseValue, byteStream.get(), UnalteredParsing); Vector<RefPtr<SVGAnimatedPathSegListPropertyTearOff> > result; SVGElementAnimatedPropertyList::const_iterator end = animatedTypes.end(); for (SVGElementAnimatedPropertyList::const_iterator it = animatedTypes.begin(); it != end; ++it) result.append(castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(it->properties[0].get())); SVGElementInstance::InstanceUpdateBlocker blocker(property->contextElement()); size_t resultSize = result.size(); for (size_t i = 0; i < resultSize; ++i) result[i]->animationStarted(byteStream.get(), &baseValue); return SVGAnimatedType::createPath(byteStream.release()); }