I'm starting to use Canvas (with GWT), do we need to implement double buffering ourselves? Wondering if somehow the browsers instead implement this for us already.
Thanks
You absolutely do not need to implement double buffering yourself and doing so would be a waste of time and performance.
Lucky for us every canvas implementation implements it behind-the-scenes for you.
Here's a simple example of it in action: http://jsfiddle.net/HYVLj/
I know it's quite an old thread, but I wanted to point out that the Fiddle in Simon Sarris answer seems wrong. When I tried it on Google Chrome, I inserted an alert statement between lines 10 and 11 (just before the loop) and the square had disappeared, just to reappear after I closed the alert window. It seems that the loop is not executed correctly. Maybe javascript optimized it out. Anyway, it seems to me that no double buffering is done. Correct me if I'm wrong.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With