Making animations reliable
The following discussion from !783 (merged) should be addressed:
-
a discussion: (+2 comments)
The issue with animations is that if the relevant scenegraph elements are visible on any output, the animation updates should be tied to updates on that output, and also cause damage on that output to ensure the output will keep on updating as long as the animation runs. This has a couple of problems:
- If the animation doesn't actually change anything on screen for a moment, then ideally it should not cause any damage that frame. Not having damage means the renderer will not be called to repaint. If don't know which signal animations hook up to, but it's possible this might then get stuck until something else causes damage.
- If the animation elements are completely outside of any output, tying the animation to an output is unnecessary and perhaps hard to maintain due to how views gets their outputs assigned automatically. But the animation still need to advance, so it should use a timer until any element becomes visible on any output.
- The transition between timer and output scheduled animation updates can happen in both directions: a view could slide from outside onto an output, or from an output to outside before it completes. I suspect we have various kludges around all animations to ensure they actually run and finish because of this.