Re: [css3-transitions] Frame Rate

On Sat, Sep 29, 2012 at 11:46 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 9/29/12 1:47 PM, Rik Cabanier wrote:
>
>>     Why, exactly?  That's certainly not the case in Gecko, as long as
>>     the sum of the times for those two callbacks is less than 16ms.
>>
>> ah, so gecko actually measures the time?
>> I wonder how it could do that though since it can't predict how long a
>> callback is going to take.
>>
>
> I'm not sure I follow.  What Gecko does is that it has a single heartbeat
> timer per tab that requestAnimationFrame runs from.  When the timer fires,
> any animation callback requests for that tab are run.  No prediction of any
> sort involved.


Cool!
What happens if a callback (or series of them) takes longer than 1/60 of a
second?



>
>
>  I was told that webkit does a render pass after every event to keep the
>> page responsive.
>>
>
> Could be, but nothing in the spec requires any sort of behavior like that,


Yes, that is a problem for people doing animations.


>
>
>      I'm not sure I follow your distinction between "the movie" and "the
>>     callback" here.  Can you please explain?
>>
>> Render passes are being skipped but not actionscript code.
>>
>
> So the point of requestAnimationFrame is that you _can_ skip code as
> needed.  If you have to run it at 30Hz instead of 60, the animation will
> move just as fast, but less smoothly.  Assuming the person doing the coding
> did it right, of course.
>

Code will be skipped by the browser. I as a developer have no control over
this and would have to figure out if there are missing callbacks.


>
> Note that requestAnimationFrame is meant for smooth-interpolation
> animations, not frame-based ones.  There is no good solution in the web
> platform right now for true frame-based animations.


Correct.
It's meant for smooth animations, not perfectly synced ones. I'm unsure if
there's enough traction to have them both available.
For games and synchronized media, perfect syncing is desired, but as we
witnessed, content that worked fine on powerful desktop might not perforrm
as well on low powered devices.

Received on Saturday, 29 September 2012 19:21:58 UTC