Bug 96338 - Drive SVG animations via requestAnimationFrame
Summary: Drive SVG animations via requestAnimationFrame
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-10 16:51 PDT by Philip Rogers
Modified: 2014-05-12 07:30 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Rogers 2012-09-10 16:51:56 PDT
We currently hook SVG animations on a 40fps timer:
SMILTimeContainer.cpp, static const double animationFrameDelay = 0.025.

If we hooked up to requestAnimationFrame, we could draw at 60fps and not slow foreground pages down when we are a background tab.

@Niko, @Dirk, can you think of any reason this wouldn't work?
Comment 1 Dirk Schulze 2012-09-10 17:11:09 PDT
Adding Arvid to this bug report. As far as I understood, he was working on that before. Maybe he can give more input of even add a patch :)
Comment 2 Dirk Schulze 2012-09-10 17:18:53 PDT
(In reply to comment #1)
> Adding Arvid to this bug report. As far as I understood, he was working on that before. Maybe he can give more input of even add a patch :)

Just as a general comment: Yes!!! It should work with requestAnimationFrame!
Comment 3 Nikolas Zimmermann 2012-09-10 23:53:32 PDT
I have an unfinished branch which unifies SMIL CSS animations with our existing CSS Animations/Transitions frameworks. I think some bugs were left to fix. Would this could help you?
Comment 4 Arvid Nilsson 2012-09-11 00:07:24 PDT
(In reply to comment #3)
> I have an unfinished branch which unifies SMIL CSS animations with our existing CSS Animations/Transitions frameworks. I think some bugs were left to fix. Would this could help you?

I was actually investigating whether I could move to RAF instead of the CSS animation timer in WebCore. At that time, The AnimationController was also using a 40 fps timer. I haven't looked into SVG animations, but it sounds very similar.