There’s a pretty impressive demo called HWACCEL which is quite slow on computers that are ostensibly hardware accelerated. To understand why, you need to understand a little bit about how HWACCEL is built.
A little bit about HWACCEL
HWACCEL creates a big HTML5 canvas, then uses the canvas drawImage function to draw lots of images.
Why is canvas slow on hardware accelerated computers?
Canvas is a general drawing API. Hardware accelerating general drawing APIs is quite hard; Microsoft wrote a framework called Direct2D that uses your DirectX 10 hardware to hardware accelerate a lot of different things, and we use this framework where it’s available (Windows Vista and 7). It doesn’t exist anywhere else, though, so we can only use the somewhat more limited 3D functionality provided by frameworks like Direct3D and OpenGL on Windows XP and Mac OS X. (For more information on the difference, see my previous blog post on how we are going to hardware accelerate Firefox 4.)
So canvas is always going to be slow, then?
Not if we can help it! Writing a hardware accelerated backend to canvas is tough, but it’s doable. We might try to use Cairo’s OpenGL backend. We also might try collaborating with some of the other browser maker. As I’m sure it’s clear, we haven’t quite worked out what the path to success will be, just that we need one.
When’s all this going to happen?
Later. Not for Firefox 4, for sure; with some hard work and a little bit of luck, we might have something for 4.next. We welcome folks helping us out – right now, that means helping us fix the Graphics bugs blocking us from releasing Firefox 4. Join us on Mozilla IRC, channel #gfx, if you’re interested!

