Bug 1324591 - Report janked animations to the main-thread and update them on the main-thread. r=botond,boris

The machinery to report janked animations is;

1) Store the partial pre-rendered animation id and the Animation object in a
   hashtable in LayerManager
2) Store the animation id in the Animation object as well
3) When we detect jank, we send the animation id to the main-thread via an IPC
   call
4) Find the Animation object with the id in the hashtable and update the
   Animaiton
5) Whenever the partial pre-rendered Animation stop running on the compositor
   i.e. the Animation finished normally, the Animation's target element is
   changed, etc. etc., remove the Animation from the hashtable

Depends on D75731

Differential Revision: https://phabricator.services.mozilla.com/D75732
This commit is contained in:
Hiroyuki Ikezoe
2020-07-05 11:45:01 +00:00
parent 2e32e24613
commit 98c4bd8d3f
19 changed files with 220 additions and 27 deletions

View File

@@ -183,6 +183,11 @@ void Animation::SetEffectNoUpdate(AnimationEffect* aEffect) {
// Break links with the old effect and then drop it.
RefPtr<AnimationEffect> oldEffect = mEffect;
mEffect = nullptr;
if (IsPartialPrerendered()) {
if (KeyframeEffect* oldKeyframeEffect = oldEffect->AsKeyframeEffect()) {
oldKeyframeEffect->ResetPartialPrerendered();
}
}
oldEffect->SetAnimation(nullptr);
// The following will not do any notification because mEffect is null.