Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML 5 canvas clip very costly

Tags:

I have serious performance problems using canvas clip() with chrome.

I have made a test case to illustrate.

Even in a simple case like this the red rectangle blinks as if it takes too much time to redraw, and a CPU profiling shows the clip() method takes about 10% of the CPU.

In my real program, it get to 16% and keep increasing each frame until the canvas almost freezes the browser..

Is there something wrong in my use of clip ?

Thank you for any suggestions,

Regards.