Bug 167825 - Change the CSS animation timer a to be little more than 60fps to ensure we hit that frame rate
Summary: Change the CSS animation timer a to be little more than 60fps to ensure we hi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-03 20:18 PST by Said Abou-Hallawa
Modified: 2017-02-06 14:00 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.52 KB, patch)
2017-02-03 20:54 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff
Patch (1.69 KB, patch)
2017-02-06 11:48 PST, Said Abou-Hallawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2017-02-03 20:18:52 PST
The system timer fires little bit slower than 60fps. This might cause the frame to be missed and hence can lower the frame rate significantly. The CSS animation frame rate on iOS is almost 40fps. The rAF timer was set to 15ms for the same reason. So we need to set the repeated CSS animation timer also to 15ms.
Comment 1 Said Abou-Hallawa 2017-02-03 20:54:29 PST
Created attachment 300598 [details]
Patch
Comment 2 Said Abou-Hallawa 2017-02-06 11:48:26 PST
Created attachment 300744 [details]
Patch
Comment 3 Sam Weinig 2017-02-06 11:55:24 PST
Comment on attachment 300744 [details]
Patch

This seems very fragile.  Is the plan to move this toward using the actual display link?
Comment 4 Said Abou-Hallawa 2017-02-06 12:25:25 PST
(In reply to comment #3)
> Comment on attachment 300744 [details]
> Patch
> 
> This seems very fragile.  Is the plan to move this toward using the actual
> display link?

I agree. And this is why I logged and created a patch for https://bugs.webkit.org/show_bug.cgi?id=167720. It makes the CSS animation controller a client of the DisplayRefreshMonitor. Instead of using a repeated timer, the CSS animation controller can schedule for the next display link firing.

But we have a bigger plan which will make all kinds of animations be controlled by one central  animation controller: https://bugs.webkit.org/show_bug.cgi?id=167899. The goal is be able to align animations with different frame rates properly.

So I do not think I am going to land https://bugs.webkit.org/show_bug.cgi?id=167720 since most likely this new code will be removed soon anyway.

In the mean time this patch fixes the frame rate of the CSS animation on iOS. We have been using a similar trick for rAF. Please see the definition of MinimumAnimationInterval in WebCore/dom/ScriptedAnimationController.cpp.

This fix is just a temporary one which we know it worked in the past.
Comment 5 WebKit Commit Bot 2017-02-06 14:00:11 PST
Comment on attachment 300744 [details]
Patch

Clearing flags on attachment: 300744

Committed r211748: <http://trac.webkit.org/changeset/211748>
Comment 6 WebKit Commit Bot 2017-02-06 14:00:15 PST
All reviewed patches have been landed.  Closing bug.