bool addToSVGPathByteStream(SVGPathByteStream* fromStream, SVGPathByteStream* byStream, unsigned repeatCount) { ASSERT(fromStream); ASSERT(byStream); if (fromStream->isEmpty() || byStream->isEmpty()) return true; SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(fromStream); auto fromStreamCopy = fromStream->copy(); fromStream->clear(); auto fromSource = std::make_unique<SVGPathByteStreamSource>(fromStreamCopy.get()); auto bySource = std::make_unique<SVGPathByteStreamSource>(byStream); SVGPathBlender* blender = globalSVGPathBlender(); bool ok = blender->addAnimatedPath(fromSource.get(), bySource.get(), builder, repeatCount); blender->cleanup(); return ok; }
bool addToSVGPathByteStream(SVGPathByteStream* fromStream, SVGPathByteStream* byStream, unsigned repeatCount) { ASSERT(fromStream); ASSERT(byStream); if (fromStream->isEmpty() || byStream->isEmpty()) return false; SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(fromStream); OwnPtr<SVGPathByteStream> fromStreamCopy = fromStream->copy(); fromStream->clear(); OwnPtr<SVGPathByteStreamSource> fromSource = SVGPathByteStreamSource::create(fromStreamCopy.get()); OwnPtr<SVGPathByteStreamSource> bySource = SVGPathByteStreamSource::create(byStream); SVGPathBlender* blender = globalSVGPathBlender(); bool ok = blender->addAnimatedPath(fromSource.get(), bySource.get(), builder, repeatCount); blender->cleanup(); return ok; }