News for hackers. Stuff that matters.
Re:Improving HTML5 Canvas Performance by p0nce on Tuesday September 04, 2012 @12:51PM (#4475369)
> re-use your gradients as much as possible, and try to avoid creating them in loops. If you have one gradient that fills several figures you should be making it only once. The function createLinearGradient(x0, y0, x1, y1) goes from one point to another, but you can make your gradient at the origin createLinearGradient(0, 0, toX, toY) and then translate it into the correct location for each figure made in the for loop.

Very true, I did exactly that for http://www.gamesfrommars.fr/demojsv2/

There are no comments on this comment yet.