mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 22:55:23 +00:00
b47411b097
In some circumstances when composing style, we tweak the time of the animation before telling the effect to compose style. This is to avoid visual flicker in certain situations where the main thread progress is being synchronized with an animation running on the compositor. In the past, effects would store their latest sample time locally so when tweaking the animation time, we would need to call UpdateEffect() after tweaking the time, and then again after restoring it as otherwise the style composed by the effect would not reflect the adjusted time. Now, however, effect's always query their animation for the time so this is no longer necessary. Furthermore, the actions triggered by UpdateEffect are not desirable in this case because they can, amongst other things, cause the associated EffectSet to be destroyed and recreated. Specifically, Animation::UpdateEffect() calls KeyframeEffectReadOnly::NotifyAnimationTimingUpdated() which: * Calls UpdateTargetRegistration which can trigger EffectSet destruction/creation which is undesirable in this case because we intend to restore whatever changes we make to the Animation's state and deleting and recreating the EffectSet will cause any pointers to it to dangle. * Cause us to possibly reset the "is running on compositor" status. This too is undesirable since we intend to restore the state of the Animation immediately after tweaking the hold time so we don't want to act as if any state has changed. * Similarly for marking the cascade as possibly needing an update or requesting a restyle. In summary, all the actions performed by NotifyAnimationTimingUpdated are unnecessary and undesirable in this situation where we are temporarily tweaking an Animation's current time only to restore it immediately afterwards since the actions are all involved with recognizing actual changes in state. |
||
---|---|---|
.. | ||
test | ||
Animation.cpp | ||
Animation.h | ||
AnimationComparator.h | ||
AnimationEffectReadOnly.cpp | ||
AnimationEffectReadOnly.h | ||
AnimationEffectTimingReadOnly.cpp | ||
AnimationEffectTimingReadOnly.h | ||
AnimationTimeline.cpp | ||
AnimationTimeline.h | ||
AnimationUtils.cpp | ||
AnimationUtils.h | ||
AnimValuesStyleRule.cpp | ||
AnimValuesStyleRule.h | ||
ComputedTimingFunction.cpp | ||
ComputedTimingFunction.h | ||
DocumentTimeline.cpp | ||
DocumentTimeline.h | ||
EffectCompositor.cpp | ||
EffectCompositor.h | ||
EffectSet.cpp | ||
EffectSet.h | ||
KeyframeEffect.cpp | ||
KeyframeEffect.h | ||
moz.build | ||
PendingAnimationTracker.cpp | ||
PendingAnimationTracker.h | ||
PseudoElementHashEntry.h |