本文整理汇总了C++中OwnPtrWillBeRawPtr::append方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnPtrWillBeRawPtr::append方法的具体用法?C++ OwnPtrWillBeRawPtr::append怎么用?C++ OwnPtrWillBeRawPtr::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OwnPtrWillBeRawPtr
的用法示例。
在下文中一共展示了OwnPtrWillBeRawPtr::append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getActiveInterpolations
void InterpolationEffect::getActiveInterpolations(double fraction, double iterationDuration, OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>>& result) const
{
if (!result)
result = adoptPtrWillBeNoop(new WillBeHeapVector<RefPtrWillBeMember<Interpolation>>());
size_t existingSize = result->size();
size_t resultIndex = 0;
for (const auto& record : m_interpolations) {
if (fraction >= record->m_applyFrom && fraction < record->m_applyTo) {
RefPtrWillBeRawPtr<Interpolation> interpolation = record->m_interpolation;
double localFraction = (fraction - record->m_start) / (record->m_end - record->m_start);
if (record->m_easing)
localFraction = record->m_easing->evaluate(localFraction, accuracyForDuration(iterationDuration));
interpolation->interpolate(0, localFraction);
if (resultIndex < existingSize)
(*result)[resultIndex++] = interpolation;
else
result->append(interpolation);
}
}
if (resultIndex < existingSize)
result->shrink(resultIndex);
}