title: Html Canvas - Translate, Rotate, Clip - Faster restores with using context.restore
body: <p>After asking a question regarding animation speed a few days ago, the stackoverflow gang once again solved my problem. However, this has led to another question. [The more you know, the more you realise you don't know.]</p>
  
  <p>Basically the fewer state changes to my canvas, the faster things will go. If I am just changing the fillStyle, then using ctx.save and ctx.restore is overkill, as all states are restored. Overkill = Slow. Instead just keep the oldvalue of fillStyle somewhere and put just that back in once you have finished.</p>
  
  <p>So how do you do this for ctx.translate(x, y), ctx.rotate(angle) and ctx.clip()?</p>
  
  <p>How can I restore these guys to their states before my changes WITHOUT having to use ctx.restore?</p>