diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-09-18 15:53:33 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-09-18 15:53:33 +0200 |
commit | 6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2 (patch) | |
tree | d9c68d1cca0b3e352f1e438561f3e504e641a08f /Source/WebCore/svg/SVGPathUtilities.cpp | |
parent | d0424a769059c84ae20beb3c217812792ea6726b (diff) | |
download | qtwebkit-6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2.tar.gz |
Imported WebKit commit c7503cef7ecb236730d1309676ab9fc723fd061d (http://svn.webkit.org/repository/webkit/trunk@128886)
New snapshot with various build fixes
Diffstat (limited to 'Source/WebCore/svg/SVGPathUtilities.cpp')
-rw-r--r-- | Source/WebCore/svg/SVGPathUtilities.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/WebCore/svg/SVGPathUtilities.cpp b/Source/WebCore/svg/SVGPathUtilities.cpp index a5af9e704..9caf6a406 100644 --- a/Source/WebCore/svg/SVGPathUtilities.cpp +++ b/Source/WebCore/svg/SVGPathUtilities.cpp @@ -140,6 +140,28 @@ bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPat return ok; } +bool appendSVGPathByteStreamFromSVGPathSeg(PassRefPtr<SVGPathSeg> pathSeg, SVGPathByteStream* result, PathParsingMode parsingMode) +{ + ASSERT(result); + // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! + ASSERT(parsingMode == UnalteredParsing); + + SVGPathSegList appendedItemList(PathSegUnalteredRole); + appendedItemList.append(pathSeg); + OwnPtr<SVGPathByteStream> appendedByteStream = SVGPathByteStream::create(); + + SVGPathByteStreamBuilder* builder = globalSVGPathByteStreamBuilder(appendedByteStream.get()); + OwnPtr<SVGPathSegListSource> source = SVGPathSegListSource::create(appendedItemList); + SVGPathParser* parser = globalSVGPathParser(source.get(), builder); + bool ok = parser->parsePathDataFromSource(parsingMode, false); + parser->cleanup(); + + if (ok) + result->append(appendedByteStream.get()); + + return ok; +} + bool buildPathFromByteStream(SVGPathByteStream* stream, Path& result) { ASSERT(stream); |