There's a trick where you layer Canvas elements on top of each other,
because you don't necessarily want to redraw everything, only what's
changed.  I have an example (though no source code available yet):

http://gdldemo.appspot.com/


On Fri, Apr 5, 2013 at 11:45 AM, Thad <[email protected]> wrote:

> Without timing this, I can't say for sure. However I
> suspect ctx.clearRect(0, 0, clientWidth(), clientHeight()) is faster as it
> calls clearRect on the JavaScriptObject while creating a new Canvas
> requires the DOM to create a new object.
>
>
> On Wednesday, April 3, 2013 10:13:34 AM UTC-4, membersound wrote:
>>
>> Hi,
>>
>> when a Canvas is often cleared and redrawn (for example during a drag
>> and drop action): would it be better to call ctx.clearRect(0, 0,
>> clientWidth(), clientHeight())?
>> Or just create a new Canvas by Canvas.createIfSupported() and replace
>> the currently drawn canvas by the new one?
>>
>> Thanks
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to