I have a game loop like so:
setInterval(function()
{
context.save();
context.rect(26, 144, 745, 400);
context.clip();
context.drawImage(myImage, 100, 100, 900, 900);
context.restore();
}, 40);
As it runs the canvas gradually slows down to a stop. If I put the drawImage outside of the clipping then it runs indefinitely at the correct speed. Is there something I'm doing wrong?