1 Replies - 1834 Views - Last Post: 12 May 2013 - 07:33 AM

#1 StefanOnRails   User is offline

  • D.I.C Head

Reputation: 35
  • View blog
  • Posts: 106
  • Joined: 31-July 12

double buffering on canvas

Posted 12 May 2013 - 05:44 AM


My question isn't really how to implement double buffering, but rather if it's worth doing it. I mean, the way I did it was by having two layered canvas elements. Basically, I was drawing on the hidden layer and when it was done I was swap-ing the visibility of the two layers. I saw no performance improvements, but rather a small flickering once in a while. Have I done anything wrong or it is simply not worth implementing.
Is This A Good Question/Topic? 0
  • +

Replies To: double buffering on canvas

#2 Atli   User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4240
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: double buffering on canvas

Posted 12 May 2013 - 07:33 AM


I'm not sure about this, but I would have tried drawing onto an off-screen canvas, and then drawing that canvas onto the main canvas. The drawImage method should support drawing other canvas elements directly. - I see a potential performance issue with this, but if the browsers handle it correctly that shouldn't be an issue.

It's worth a try at least, and it's shouldn't be difficult to modify your existing "flipping" canvases to test this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1