本文整理汇总了C++中SVGPathByteStream::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGPathByteStream::clear方法的具体用法?C++ SVGPathByteStream::clear怎么用?C++ SVGPathByteStream::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGPathByteStream
的用法示例。
在下文中一共展示了SVGPathByteStream::clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildSVGPathByteStreamFromSVGPathSegList
bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream& result, PathParsingMode parsingMode)
{
result.clear();
if (list.isEmpty())
return true;
SVGPathSegListSource source(list);
return SVGPathParser::parseToByteStream(source, result, parsingMode);
}
示例2: buildSVGPathByteStreamFromString
bool buildSVGPathByteStreamFromString(const String& d, SVGPathByteStream& result, PathParsingMode parsingMode)
{
result.clear();
if (d.isEmpty())
return true;
SVGPathStringSource source(d);
return SVGPathParser::parseToByteStream(source, result, parsingMode);
}
示例3: buildAnimatedSVGPathByteStream
bool buildAnimatedSVGPathByteStream(const SVGPathByteStream& fromStream, const SVGPathByteStream& toStream, SVGPathByteStream& result, float progress)
{
ASSERT(&toStream != &result);
result.clear();
if (toStream.isEmpty())
return true;
SVGPathByteStreamBuilder builder(result);
SVGPathByteStreamSource fromSource(fromStream);
SVGPathByteStreamSource toSource(toStream);
return SVGPathBlender::blendAnimatedPath(fromSource, toSource, builder, progress);
}
示例4: addToSVGPathByteStream
bool addToSVGPathByteStream(SVGPathByteStream& fromStream, const SVGPathByteStream& byStream, unsigned repeatCount)
{
if (fromStream.isEmpty() || byStream.isEmpty())
return true;
OwnPtr<SVGPathByteStream> fromStreamCopy = fromStream.copy();
fromStream.clear();
SVGPathByteStreamBuilder builder(fromStream);
SVGPathByteStreamSource fromSource(*fromStreamCopy);
SVGPathByteStreamSource bySource(byStream);
SVGPathBlender blender(&fromSource, &bySource, &builder);
return blender.addAnimatedPath(repeatCount);
}
示例5: buildSVGPathByteStreamFromString
bool buildSVGPathByteStreamFromString(const String& d, SVGPathByteStream& result, PathParsingMode parsingMode)
{
result.clear();
if (d.isEmpty())
return true;
// The string length is typically a minor overestimate of eventual byte stream size, so it avoids us a lot of reallocs.
result.reserveInitialCapacity(d.length());
SVGPathByteStreamBuilder builder(result);
SVGPathStringSource source(d);
SVGPathParser parser(&source, &builder);
bool ok = parser.parsePathDataFromSource(parsingMode);
result.shrinkToFit();
return ok;
}
示例6: addToSVGPathByteStream
bool addToSVGPathByteStream(SVGPathByteStream& streamToAppendTo, const SVGPathByteStream& byStream, unsigned repeatCount)
{
// Why return when streamToAppendTo is empty? Don't we still need to append?
if (streamToAppendTo.isEmpty() || byStream.isEmpty())
return true;
// Is it OK to make the SVGPathByteStreamBuilder from a stream, and then clear that stream?
SVGPathByteStreamBuilder builder(streamToAppendTo);
SVGPathByteStream fromStreamCopy = streamToAppendTo;
streamToAppendTo.clear();
SVGPathByteStreamSource fromSource(fromStreamCopy);
SVGPathByteStreamSource bySource(byStream);
return SVGPathBlender::addAnimatedPath(fromSource, bySource, builder, repeatCount);
}