mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1344619 - Part 2: Introduce EffectCompositor::PreTraverse(). r=birtles
MozReview-Commit-ID: 6ijDJttB9eo --HG-- extra : rebase_source : 451601b1daf37e7b36d0b8ecda71c34388b78412
This commit is contained in:
parent
f9b0c33a05
commit
90d73a1135
@ -940,6 +940,40 @@ EffectCompositor::SetPerformanceWarning(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EffectCompositor::PreTraverse()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
MOZ_ASSERT(mPresContext->RestyleManager()->IsServo());
|
||||||
|
|
||||||
|
for (auto& elementsToRestyle : mElementsToRestyle) {
|
||||||
|
for (auto iter = elementsToRestyle.Iter(); !iter.Done(); iter.Next()) {
|
||||||
|
bool postedRestyle = iter.Data();
|
||||||
|
// Ignore throttled restyle.
|
||||||
|
if (!postedRestyle) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
NonOwningAnimationTarget target = iter.Key();
|
||||||
|
EffectSet* effects =
|
||||||
|
EffectSet::GetEffectSet(target.mElement, target.mPseudoType);
|
||||||
|
if (!effects) {
|
||||||
|
// Drop the EffectSets that have been destroyed.
|
||||||
|
iter.Remove();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (KeyframeEffectReadOnly* effect : *effects) {
|
||||||
|
effect->GetAnimation()->WillComposeStyle();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the element from the list of elements to restyle since we are
|
||||||
|
// about to restyle it.
|
||||||
|
iter.Remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Nested class: AnimationStyleRuleProcessor
|
// Nested class: AnimationStyleRuleProcessor
|
||||||
|
@ -233,6 +233,11 @@ public:
|
|||||||
nsCSSPropertyID aProperty,
|
nsCSSPropertyID aProperty,
|
||||||
const AnimationPerformanceWarning& aWarning);
|
const AnimationPerformanceWarning& aWarning);
|
||||||
|
|
||||||
|
// Do a bunch of stuff that we should avoid doing during the parallel
|
||||||
|
// traversal (e.g. changing member variables) for all elements that we expect
|
||||||
|
// to restyle on the next traversal.
|
||||||
|
void PreTraverse();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~EffectCompositor() = default;
|
~EffectCompositor() = default;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user