23
Nov 10

Why is HWACCEL slow on my computer?

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!


10
Nov 10

Hardware Acceleration in the latest Firefox 4 beta

The most recent Firefox 4 beta has enhanced support for hardware acceleration on Windows and Mac OS X. This release of Firefox will be faster on more webpages while at the same time being compatible with more computers.

Direct2D improvements

On Windows Vista and 7, Firefox hardware accelerates web content using Microsoft’s Direct2D framework. The latest beta of Firefox fixes bugs that made Firefox stop drawing when the graphics driver restarted. It also now has a graphics “block list” that makes sure Firefox doesn’t try to use graphics drivers or chips known to cause problems.

Hardware accelerated compositing

Firefox now hardware accelerates the composition of layers on Windows XP, Vista, and 7, and Mac OS X. If you’re running Windows, Firefox uses Direct3D-accelerated layers, while on Mac OS X, it uses OpenGL for the same task. Hardware accelerating layer composition will make some sites significantly faster; you will notice faster scrolling and faster interaction with graphically-intensive web pages. Firefox also accelerates the display of HTML5 video, giving a special boost to pages that use it.

Testing hardware acceleration

You can help us develop Firefox 4! Just use the Firefox 4 beta as your everyday browser and tell us about your experience via the Firefox Feedback button. If you notice something specific has gone wrong, you can also file a bug in Bugzilla; we have information on how to gather information for your hardware acceleration bug report too.


10
Nov 10

How to tell if you’re using hardware acceleration

Sometimes, Firefox 4 can’t use hardware acceleration. Usually, this happens because Firefox has identified your graphics card (GPU) or driver (the software that runs the GPU) as being unreliable.

To tell if you’re using hardware acceleration in Firefox, enter the address about:support into your address bar. At the bottom of that page is a section labeled “Graphics.” If you’re using hardware acceleration, this section will contain a message similar to “GPU Accelerated Windows: 1/1 Direct3D 10″.

about:support graphics section with hardware acceleration enabled

Hardware Acceleration enabled

However, if hardware acceleration is disabled automatically by Firefox, the about:support Graphics section will simply display the message “GPU Accelerated Windows: 0/1.” (Frequently, issues with graphics drivers are resolved by updating those drivers. Contact your computer or graphics card manufacturer for more details.)

about:support Graphics section with hw accel disabled

Hardware Acceleration disabled