本文整理汇总了C++中KeyframeValueList::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyframeValueList::insert方法的具体用法?C++ KeyframeValueList::insert怎么用?C++ KeyframeValueList::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyframeValueList
的用法示例。
在下文中一共展示了KeyframeValueList::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createTransformAnimationsFromKeyframes
bool GraphicsLayerAndroid::createTransformAnimationsFromKeyframes(const KeyframeValueList& valueList,
const Animation* animation,
const String& keyframesName,
double beginTime,
const IntSize& boxSize)
{
ASSERT(valueList.property() == AnimatedPropertyWebkitTransform);
TLOG("createTransformAnimationFromKeyframes, name(%s) beginTime(%.2f)",
keyframesName.latin1().data(), beginTime);
KeyframeValueList* operationsList = new KeyframeValueList(AnimatedPropertyWebkitTransform);
for (unsigned int i = 0; i < valueList.size(); i++) {
TransformAnimationValue* originalValue = (TransformAnimationValue*)valueList.at(i);
PassRefPtr<TimingFunction> timingFunction(const_cast<TimingFunction*>(originalValue->timingFunction()));
TransformAnimationValue* value = new TransformAnimationValue(originalValue->keyTime(),
originalValue->value(),
timingFunction);
operationsList->insert(value);
}
RefPtr<AndroidTransformAnimation> anim = AndroidTransformAnimation::create(animation,
operationsList,
beginTime);
if (keyframesName.isEmpty())
anim->setName(propertyIdToString(valueList.property()));
else
anim->setName(keyframesName);
m_contentLayer->addAnimation(anim.release());
needsNotifyClient();
return true;
}
示例2: createAnimationFromKeyframes
bool GraphicsLayerAndroid::createAnimationFromKeyframes(const KeyframeValueList& valueList,
const Animation* animation, const String& keyframesName, double beginTime)
{
bool isKeyframe = valueList.size() > 2;
TLOG("createAnimationFromKeyframes(%d), name(%s) beginTime(%.2f)",
isKeyframe, keyframesName.latin1().data(), beginTime);
switch (valueList.property()) {
case AnimatedPropertyInvalid: break;
case AnimatedPropertyWebkitTransform: break;
case AnimatedPropertyBackgroundColor: break;
case AnimatedPropertyOpacity: {
MLOG("ANIMATEDPROPERTYOPACITY");
KeyframeValueList* operationsList = new KeyframeValueList(AnimatedPropertyOpacity);
for (unsigned int i = 0; i < valueList.size(); i++) {
FloatAnimationValue* originalValue = (FloatAnimationValue*)valueList.at(i);
PassRefPtr<TimingFunction> timingFunction(const_cast<TimingFunction*>(originalValue->timingFunction()));
FloatAnimationValue* value = new FloatAnimationValue(originalValue->keyTime(),
originalValue->value(),
timingFunction);
operationsList->insert(value);
}
RefPtr<AndroidOpacityAnimation> anim = AndroidOpacityAnimation::create(animation,
operationsList,
beginTime);
if (keyframesName.isEmpty())
anim->setName(propertyIdToString(valueList.property()));
else
anim->setName(keyframesName);
m_contentLayer->addAnimation(anim.release());
needsNotifyClient();
return true;
} break;
}
return false;
}