Bug 1479173 - Call EffectSet::GetEffectSet in CanThrottle just once. r=birtles

Depends on D10693

Differential Revision: https://phabricator.services.mozilla.com/D10694

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Hiroyuki Ikezoe 2018-11-06 21:02:06 +00:00
Родитель 319493d9fc
Коммит 217607fd0b
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -1248,6 +1248,7 @@ KeyframeEffect::CanThrottle() const
}
}
EffectSet* effectSet = nullptr;
for (const LayerAnimationInfo::Record& record :
LayerAnimationInfo::sRecords) {
// Skip properties that are overridden by !important rules.
@ -1259,10 +1260,12 @@ KeyframeEffect::CanThrottle() const
continue;
}
EffectSet* effectSet = EffectSet::GetEffectSet(mTarget->mElement,
mTarget->mPseudoType);
MOZ_ASSERT(effectSet, "CanThrottle should be called on an effect "
"associated with a target element");
if (!effectSet) {
effectSet = EffectSet::GetEffectSet(mTarget->mElement,
mTarget->mPseudoType);
MOZ_ASSERT(effectSet, "CanThrottle should be called on an effect "
"associated with a target element");
}
// Note that AnimationInfo::GetGenarationFromFrame() is supposed to work
// with the primary frame instead of the style frame.
Maybe<uint64_t> generation = layers::AnimationInfo::GetGenerationFromFrame(