W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Re: The need to re-subscribe to requestAnimationFrame

From: Lars Knudsen <larsgk@gmail.com>
Date: Sat, 2 Mar 2013 12:45:48 +0100
Message-ID: <CA+jkkcj7R=gfdR9TZ3aktLCzvT1m5MS=uOQ0qpj4sEvQXN2M4A@mail.gmail.com>
To: David Bruant <bruant.d@gmail.com>
Cc: Webapps WG <public-webapps@w3.org>
Without having used it too much, I'd say it is because of the following:

Imagine that you have a callback that does a lot of heavy rendering and the
rAF returns AGAIN while "// do stuff".  Then you'd all of a sudden have an
accumulating list of "do stuff'ers" that run in parallel - eating away CPU.

There is no need to ask for the next available "paint slot" until the
previous work is cleared out of the way.

Correct me if I am wrong.

- Lars


On Sat, Mar 2, 2013 at 12:03 PM, David Bruant <bruant.d@gmail.com> wrote:

> Hi,
>
> If someone wants to reuse the same function for requestionAnimationFrame,
> he/she has to go through:
>     requestAnimationFrame(function f(){
>         requestAnimationFrame(f);
>         // do stuff
>     })
>
> I was wondering why it was the case. Other event-like mechanism do not
> require to re-subscribe after an event happened.
>
> Thanks,
>
> David
>
>
Received on Saturday, 2 March 2013 11:46:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:57 GMT