本文整理汇总了C++中KeyframeEffectReadOnly::GetTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyframeEffectReadOnly::GetTarget方法的具体用法?C++ KeyframeEffectReadOnly::GetTarget怎么用?C++ KeyframeEffectReadOnly::GetTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyframeEffectReadOnly
的用法示例。
在下文中一共展示了KeyframeEffectReadOnly::GetTarget方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CascadeLevel
void
Animation::PostUpdate()
{
if (!mEffect) {
return;
}
KeyframeEffectReadOnly* keyframeEffect = mEffect->AsKeyframeEffect();
if (!keyframeEffect) {
return;
}
Maybe<NonOwningAnimationTarget> target = keyframeEffect->GetTarget();
if (!target) {
return;
}
nsPresContext* presContext = keyframeEffect->GetPresContext();
if (!presContext) {
return;
}
presContext->EffectCompositor()
->RequestRestyle(target->mElement,
target->mPseudoType,
EffectCompositor::RestyleType::Layer,
CascadeLevel());
}
示例2:
static inline Element*
GetTarget(Animation* aAnimation)
{
KeyframeEffectReadOnly* effect = aAnimation->GetEffect();
if (!effect) {
return nullptr;
}
Element* target;
nsCSSPseudoElements::Type pseudoType;
effect->GetTarget(target, pseudoType);
// If the animation targets a pseudo-element, we don't dispatch
// notifications for it. (In the future we will have PseudoElement
// objects we can use as the target of the notifications.)
if (pseudoType != nsCSSPseudoElements::ePseudo_NotPseudoElement) {
return nullptr;
}
return effect->GetTarget();
}
示例3: Nothing
Maybe<NonOwningAnimationTarget>
nsNodeUtils::GetTargetForAnimation(const Animation* aAnimation)
{
KeyframeEffectReadOnly* effect = aAnimation->GetEffect();
return effect ? effect->GetTarget() : Nothing();
}