bool buildPathFromString(const String& d, Path& result) { if (d.isEmpty()) return true; SVGPathBuilder* builder = globalSVGPathBuilder(result); auto source = std::make_unique<SVGPathStringSource>(d); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(NormalizedParsing); parser->cleanup(); return ok; }
bool SVGPathParserFactory::buildPathFromString(const String& d, Path& result) { if (d.isEmpty()) return false; SVGPathBuilder* builder = globalSVGPathBuilder(result); OwnPtr<SVGPathStringSource> source = SVGPathStringSource::create(d); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(NormalizedParsing); parser->cleanup(); return ok; }
bool buildPathFromByteStream(SVGPathByteStream* stream, Path& result) { ASSERT(stream); if (stream->isEmpty()) return true; SVGPathBuilder* builder = globalSVGPathBuilder(result); auto source = std::make_unique<SVGPathByteStreamSource>(stream); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(NormalizedParsing); parser->cleanup(); return ok; }
bool SVGPathParserFactory::buildPathFromSVGPathSegList(SVGPathSegList* pathSegList, Path& result) { ASSERT(pathSegList); if (!pathSegList->numberOfItems()) return false; SVGPathBuilder* builder = globalSVGPathBuilder(result); OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(pathSegList); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(NormalizedParsing); parser->cleanup(); return ok; }
bool SVGPathParserFactory::buildPathFromByteStream(SVGPathByteStream* stream, Path& result) { ASSERT(stream); if (stream->isEmpty()) return false; SVGPathBuilder* builder = globalSVGPathBuilder(result); OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream); SVGPathParser* parser = globalSVGPathParser(source.get(), builder); bool ok = parser->parsePathDataFromSource(NormalizedParsing); parser->cleanup(); return ok; }
bool buildPathFromByteStream(const SVGPathByteStream* stream, Path& result) { ASSERT(stream); if (stream->isEmpty()) return true; SVGPathBuilder* builder = globalSVGPathBuilder(result); SVGPathByteStreamSource source(stream); SVGPathParser* parser = globalSVGPathParser(&source, builder); bool ok = parser->parsePathDataFromSource(NormalizedParsing); parser->cleanup(); return ok; }