I would be surprised if clear() was slow.

Generally it is a good idea to clear first, especially on IE, which
has to convert the canvas calls to VML.  clear() blows away the
current VML doc, while redrawing may append to the existing.

As always, test your idea and let the real world usage decide.



On Nov 2, 3:26 am, Nerf <[email protected]> wrote:
> Hiya,
>
> Apologies if this has been asked, a quick search didn't net me
> anything. I have been playing around with the Incubator GWTCanvas and
> think it's fantastic. I have a decent little functioning framework
> now, and have begun to wonder about optimisation.
>
> My question is, if failing to Clear() the canvas between redraws
> (frames) causes the new image to be printed on the old image, is it
> theoretically more computationally expensive for each pixel of the
> second frame to be printed, even if they contain no transparency (full
> alpha)? I can see this happening at a base level due to some kind of
> alpha diff taking place, though without understanding the
> implementation I can't decide whether calling Clear(), filling the
> canvas with white/black, or just painting over the old image would be
> the fastest.
>
> I don't know if it's likely to affect my performance, but I am aiming
> for up to 20 frames a second on a 760x400 canvas, and would like to
> make it as easy as possible for the browsers to do their part.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to