本文整理汇总了C++中SVGPathByteStream::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGPathByteStream::copy方法的具体用法?C++ SVGPathByteStream::copy怎么用?C++ SVGPathByteStream::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGPathByteStream
的用法示例。
在下文中一共展示了SVGPathByteStream::copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: calculateAnimatedValue
void SVGAnimatedPathAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated)
{
ASSERT(m_animationElement);
ASSERT(m_contextElement);
SVGPathByteStream* fromPath = from->path();
SVGPathByteStream* toPath = to->path();
SVGPathByteStream* toAtEndOfDurationPath = toAtEndOfDuration->path();
SVGPathByteStream* animatedPath = animated->path();
OwnPtr<SVGPathByteStream> underlyingPath;
bool isToAnimation = m_animationElement->animationMode() == ToAnimation;
if (isToAnimation) {
underlyingPath = animatedPath->copy();
fromPath = underlyingPath.get();
}
// Cache the current animated value before the buildAnimatedSVGPathByteStream() clears animatedPath.
OwnPtr<SVGPathByteStream> lastAnimatedPath;
if (!fromPath->size() || (m_animationElement->isAdditive() && !isToAnimation))
lastAnimatedPath = animatedPath->copy();
// Pass false to 'resizeAnimatedListIfNeeded' here, as the path animation is not a regular Vector<SVGXXX> type, but a SVGPathByteStream, that works differently.
if (!m_animationElement->adjustFromToListValues<SVGPathByteStream>(*fromPath, *toPath, *animatedPath, percentage, false))
return;
buildAnimatedSVGPathByteStream(fromPath, toPath, animatedPath, percentage);
// Handle additive='sum'.
if (lastAnimatedPath)
addToSVGPathByteStream(animatedPath, lastAnimatedPath.get());
// Handle accumulate='sum'.
if (m_animationElement->isAccumulated() && repeatCount)
addToSVGPathByteStream(animatedPath, toAtEndOfDurationPath, repeatCount);
}