Consider using the last animation value on the compositor when a new transition replaces the old one
Categories
(Core :: CSS Transitions and Animations, enhancement, P3)
Tracking
()
People
(Reporter: hiro, Assigned: boris, NeedInfo)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Whiteboard: [layout:backlog])
Attachments
(2 files)
In bug 1167519, we did introduce a tweak that using a plausible start value for the new transition which replaces the old transition. But if we can get the current value on the compositor and use the value as the start value, it would be a better result, I believe.
Anyways, I don't think it's worth spending time on this right now. This should be a future work for us.
Reporter | ||
Comment 1•5 years ago
|
||
A wrong copy-and-paste. :/
Comment 2•5 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #0)
Anyways, I don't think it's worth spending time on this right now. This should be a future work for us.
I don't mind how we fix bug 1167519 but I actually think it is pretty high priority to fix it one way or another (which might not be this bug necessarily). It comes up a lot in my experience and I am constantly having to work around it.
Reporter | ||
Comment 3•5 years ago
|
||
I was thinking that we will fix this bug as a part of bug 1625029 (run more CSS properties on the compositor) because once we support animations of more CSS properties on the compositor, users might see the issue more often.
I am adding this in the dependency list of bug 1625029.
Assignee | ||
Comment 4•5 years ago
|
||
(In reply to Brian Birtles (:birtles) from comment #2)
I don't mind how we fix bug 1167519 but I actually think it is pretty high priority to fix it one way or another (which might not be this bug necessarily). It comes up a lot in my experience and I am constantly having to work around it.
OK. I may spend more time on this or Bug 1623425 first. Perhaps check why bug 1167519 doesn't fix Bug 1623425, as my first step. (Sorry, debugging other layout bugs in these two days.)
Reporter | ||
Comment 5•5 years ago
|
||
What we need to do here is
- Get the previous animation's id by calling AnimationInfo::GetCompositorAnimationsId and send the id to the compositor if we replaced the previous transition by a new transition
2a) For non WebRender, we can get the last value in AnimationInfo::SetCompositorAnimations by calling CompositorAnimationStorage::GetOMTAValue and replace the start value with the last value. (Probably we can do it in AnimationHelper::ExtractAnimations)
2b) For WebRender, we can get the last value with the same way but I don't know of the right place to do it, we need to ask someone in gfx team. Anyway an important thing is we need to do this stuff before the previous animation data is decarded
Hmm that's all we have to do? I think I am definitely missing something, but basically this should work.
Also I should note that during writing this comment, I started suspecting the animation id seems to be conflict in some cases, e.g. an animation object has multiple css propery animations such as transform and opacity.
I also realized a side effect of this approach is that the start value of the transition becomes a wrong value if user see the value in the devtools animation panel.
Assignee | ||
Comment 6•5 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #5)
2a) For non WebRender, we can get the last value in AnimationInfo::SetCompositorAnimations by calling CompositorAnimationStorage::GetOMTAValue
The OMTA value (or AnimatedValue) works well for properties except for transform/translate/rotate/scale/offset. We only store a final matrix for transform-like properties, so perhaps we have to store the last animation values for each transform-like property (if this property is a transition property).
Reporter | ||
Comment 7•5 years ago
|
||
(In reply to Boris Chiou [:boris] from comment #6)
(In reply to Hiroyuki Ikezoe (:hiro) from comment #5)
2a) For non WebRender, we can get the last value in AnimationInfo::SetCompositorAnimations by calling CompositorAnimationStorage::GetOMTAValue
The OMTA value (or AnimatedValue) works well for properties except for transform/translate/rotate/scale/offset. We only store a final matrix for transform-like properties, so perhaps we have to store the last animation values for each transform-like property (if this property is a transition property).
I see. Given that individual transform properties are not commonly used in the wild, you can do it in a followup bug.
Assignee | ||
Comment 8•5 years ago
|
||
Just rechecked the issue hiro mentioned: the start value on the devtools, and perhaps other places (e.g. sync with mouse event?):
We replace the startValue on the compositor, but the keyframe doesn't know the new start value on the main thread. This may cause some issues on the main thread. So perhaps we still have to do the replacement on the main thread, and use IPC to retrieve the last AnimationValue if possible.
Reporter | ||
Comment 9•5 years ago
|
||
(In reply to Boris Chiou [:boris] from comment #8)
Just rechecked the issue hiro mentioned: the start value on the devtools, and perhaps other places (e.g. sync with mouse event?):
We replace the startValue on the compositor, but the keyframe doesn't know the new start value on the main thread.
Yes, I've noticed it.
This may cause some issues on the main thread.
Do you ever notice actual issues? The only one issue I was thinking is that the start value of the transition in devtools animation inspector might be wrong (but I haven't checked).
So perhaps we still have to do the replacement on the main thread, and use IPC to retrieve the last AnimationValue if possible.
I had a plan to add an IPC call from the compositor to the main-thread to tell the fact that an animation caused a janky situation on the compositor for bug 1324591. But after some chats with botond, I decided I am not going to add the IPC call initially.
Anyways, my question is what the actual issues are? I think the devtools' one is not a big problem at all.
Assignee | ||
Comment 10•5 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #9)
Anyways, my question is what the actual issues are? I think the devtools' one is not a big problem at all.
I'm still checking this. I still saw some back and forth issues when I have some mouse events. The log looks like if we have a main thread compose during the sampling, the start value would be rolled back to the original incorrect one. (i.e. not the one I just update by the last AnimationValue). Perhaps I miss something.
Assignee | ||
Comment 11•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 12•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 13•5 years ago
|
||
Boris, can you please rebase patches here? I am going to finish writing up patches for bug 1634945. There is another bug report (bug 1638444), in that case it's background transitions. Anyways we should at least fix the issue visually even if the transition's keyframe vale is odd (that's been odd regardless of those fixes).
Assignee | ||
Comment 14•5 years ago
|
||
OK. I'm rebasing these.
Assignee | ||
Comment 15•5 years ago
|
||
I pushed the rebased patches. Please let me know if you see any build errors. :)
Reporter | ||
Comment 16•5 years ago
|
||
Thanks! Yep, there are a bunch of build errors due to recent nsTArray changes.
Assignee | ||
Comment 17•5 years ago
|
||
OK. I should run local build to fix them. :) Thanks.
Assignee | ||
Comment 18•5 years ago
|
||
Working on the compilation errors now. Sorry for the inconvenience.
Reporter | ||
Comment 19•5 years ago
|
||
No worries. Don't need to rush at all.
Assignee | ||
Comment 20•5 years ago
|
||
OK. We should always use "move" for AnimatedValue and AnimationTransform. These patches are updated.
Comment 22•2 years ago
|
||
Boris, do you still intend to land this? Just asking because I notice there is a new dupe of it.
Assignee | ||
Comment 23•2 years ago
|
||
I may have to revisit these patches. Keep the ni for myself.
Updated•2 years ago
|
Description
•