User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:18.104.22.168) Gecko/20071025 Firefox/22.214.171.124 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:126.96.36.199) Gecko/20071025 Firefox/188.8.131.52 If the "width" and "height" attributes of the canvas tag aren't equal to its actual width and height on screen, drawing becomes much slower. Machine is 3GHz Pentium, I draw 4 lines in fullscreen at every frame, framerate drops to single digits. Testcase attached. Reproducible: Always Steps to Reproduce: Open the testcase from the URL field. Expand window to fullscreen. Move the mouse around. Click to switch slow/fast.
Just took a guess on component, but pretty sure this is a core bug. Could be all gone on the trunk (pre-beta Firefox 3). Good to understand in any event. /be
The width and height attributes correspond to the width and height of the image in the canvas (the size of the bitmap). If the size on screen is different, the bitmap needs to be scaled on every draw operation (as with any image). This is, of course, slower than just painting it without scaling. For what it's worth, the testcase is just slow here no matter what I do, both in "slow" and "fast" mode. ;)