[Webkit-unassigned] [Bug 127014] AnimationController: replace animation timer with compositor-driven mechanism

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 14 16:01:56 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=127014





--- Comment #3 from Ralph T <ralpht+bugs at gmail.com>  2014-01-14 15:59:33 PST ---
I switched the timer in AnimationController out for a new "AnimationTimer". AnimationTimer uses Document::requestAnimationFrame to schedule callbacks when there's no interval and when repeating -- otherwise it falls back to a traditional timer and then uses requestAnimationFrame. This requires that REQUEST_ANIMATION_FRAME is enabled.

The goal of this is to have unaccelerated CSS animations run synced with the compositor. On ports where the compositor calls serviceScriptedAnimations directly prior to flushing layers for a new frame (I do this and CoordinatedGraphics does this when R_A_F_TIMER and R_A_F_DISPLAY_MONITOR are disabled) this change results in smooth 60Hz animations.

On mac, the animation is still chunky which must be due to the rAF callbacks being driven by the DisplayMonitor instead of from the compositor when it begins compositing.

There was previous work done to achieve the same goal, here: https://bugs.webkit.org/show_bug.cgi?id=64591

I disabled this change in my patch because it has some negative consequences:

 1. When an accelerated CSS animation is running or scheduled, AnimationController will invalidate style every time some other unrelated paint happens.

 2. I see some duplicated work -- on some frames the animation code runs twice, so there are two style invals and two layouts per painted and composited frame. I think this is because the old animation timer is still running even though the rAF timer is more frequent and should be doing all the work. Visually this causes jitter as some frames get calculated late if the WebProcess was busy handling the animation timer when it should have been calculating for the compositor/rAF tiemr.

I didn't remove any of the code in AnimationController for serviceAnimations, but it's not called any more.

I'd love to get some feedback on this approach, so my questions are:
 1. Is it appropriate to use the rAF timer mechanism for the AnimationController?

 2. Do you know why the rAF callbacks on mac seem uneven? This was briefly discussed in bug 64591. It's almost like the compositor and rAF timer aren't in sync.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list