SMIL:Animation Controller: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (SVG:Animation Controller moved to SMIL:Animation Controller: Moving SMIL pages (all 5) that we currently have on the wiki to their own section separate from SVG, since that seems like a good idea in the long run.) |
| (One intermediate revision by the same user not shown) | |
(No difference)
| |
Latest revision as of 13:43, 20 March 2009
We need the following features from a global animation controller:
- Register and unregister active animations
- Periodically invoke a callback on each active animation
- Serves a timestamp that's fixed during each animation step
- Self-tuning animation rate
Should it be per-document or per-view-manager-tree? I suspect per-document.
class nsPresContext {
public:
nsAnimationController* AnimationController();
};
class nsAnimationController {
public:
// Animations should be weakly referenced; if the animation object
// goes away, then it's automatically unregistered
void RegisterAnimation(nsIAnimation* aAnimation);
void UnregisterAnimation(nsIAnimation* aAnimation);
/**
* This returns the timestamp of the current animation step. It's updated
* just once per step. Should probably be callable anytime; if it's
* not in an explicit animation step, we pretend that the current event
* is an animation step --- that way, starting a bunch of animations
* during the same event gives them all exactly the same start time.
*/
PRTime GetCurrentTime();
};
class nsIAnimation : public nsISupportsWeakReference {
public:
void NotifyAnimationStep();
}