• On The Insider: Erin Andrews Stays with ESPN
November 24, 2009 4:00 AM PST

Firefox hopes to one-up IE with fast graphics

by Stephen Shankland

Last week, Microsoft showed off some browser technology that could help Internet Explorer leapfrog the competition. But if Mozilla succeeds in its hope, Microsoft could be playing catch-up instead.

The technology in question is hardware-accelerated graphics and text using interfaces called Direct2D and DirectWrite that provide an easy way to use graphics cards' computing power. They're built into Windows 7, and Microsoft is bringing them to Windows Vista but not Windows XP.

The performance boost from Direct2D and DirectWrite was the centerpiece of Microsoft's demonstration of Internet Explorer 9 goodies shown last week. Online maps flashed on the screen quickly and tracked mouse movements responsively; text was clearer and changed sizes more gracefully.

But the day of Microsoft's demo, Mozilla evangelist Chris Blizzard had this to tweet: "Interesting that we're doing Direct2D support in Firefox as well--I'll bet we'll ship it first."

There's work to back up his rhetoric. On Sunday, Bas Schouten, the programmer who's been leading the work for Mozilla, posted a prototype of Firefox using the Direct2D and DirectWrite.

However, any Firefox fans tempted to crow about a victory should be cautious. Mozilla wouldn't commit to including the technology, much less to a release schedule such as Firefox 3.7 due in the first half of 2010. "We are currently investigating Direct2D for Firefox, but do not have a target for shipping it in Firefox at this time," the organization said in a statement..

Several Web pages arrive significantly faster using Direct2D rendering technology in Firefox.

Several Web pages arrive significantly faster using Direct2D rendering technology in Firefox.

(Credit: Bas Schouten)

The race is on
Microsoft declined to comment for this story, referring readers just to last week's blog post about coming Internet Explorer 9 features. "While we're still early in the product cycle, we wanted to be clear to developers about our approach and the progress so far," the company said while sharing a Direct2D demonstration video.

There's no doubt the race is on, though, given the potential benefits of the new interface and the commercial success of Window 7. Microsoft is lighting a fire under its developers, but the company's browser has lagged Firefox and other rivals in many technological areas for years, and many Web developers loathe earlier versions of IE still widely used. IE's market share has steadily eroded, though it remains dominant overall.

The attention is giving Google ideas, too. In a Chrome issue logged Sunday, Chrome programmer Peter Kasting pointed to Schouten's blog post on the subject as "motivation."

"If we can speed up the rendering time, the most noticeable benefit will probably be smoother-feeling scrolling," Kasting said. He also directed attention in October to DirectWrite support in Chrome, though cautioning that it might not work with the browser's present "sandbox" design to isolate elements of the browser for security reasons.

Mozilla has its own results to show off, too. Schouten offered a graph showing improved performance displaying a variety of Web pages. Facebook, Google, and Twitter rendered on the screen in half the time using the Direct2D; Slashdot and a Wikipedia entry were barely changed. One taxing page using the Scalable Vector Graphics format (SVG) to show movable, resizable graphics showed more than twice as fast, dropping from about 11 milliseconds to less than 4 milliseconds.

Microsoft's DirectWrite permits smoother display of many fonts.

Microsoft's DirectWrite permits smoother display of many fonts.

(Credit: Microsoft)

What actually changes?
Direct2D replaces an older technology called Graphics Device Interface (GDI) used in Windows XP. Both offer a way for programs to tap into computing hardware without having to worry about the particulars of video card capabilities and settings, but Direct2D taps into hardware acceleration features.

The technology lets programmers control basic elements such as transparent boxes, curved lines, and resizable photos. Out of these, user interface elements are constructed; Direct2D calls upon a computer's graphics processor to speed that up. It's particularly helpful for dynamic situations that change element properties such as color, size, or opacity.

DirectWrite offers a similar graphics chip boost to the task of displaying text. That may not sound computationally intense, but some parts of it are. In particular, DirectWrite offers a more sophisticated mechanism for displaying text to take advantage of something called sub-pixel positioning of letters.

Each pixel on an LCD screen is actually made of three tiny slices--for red, green, and blue components--and sub-pixel technology subtly draws letters using pieces of these pixels to make the overall appearance smoother. The older GDI permitted some sub-pixel positioning, but only smoothed letters in the horizontal direction; DirectWrite smooths curves vertically as well.

Using the graphics chip in Direct2D and DirectWrite operations brings several advantages. Performance is the first: some operations are faster or smoother, and having more power on hand lets programmers tackle more ambitious projects. Second, the general-purpose central processor, relatively inefficient at handling graphics tasks, is unburdened, freeing it up for other tasks and saving battery power.

Firefox already has a graphics system of its own called Cairo. Schouten has been adding a Direct2D and DirectWrite.

Firefox is of course a browser that doesn't just work on Windows. The DirectWrite technology helps that operating system catch up to its rivals, said Mozilla's John Daggett in a blog post Sunday. "Platform APIs [application programming interfaces] on Mac OS X and Linux already do a good job rendering Postscript CFF [Compact Font Format] fonts," he said. "This just brings them up to parity under Windows 7."

Direct2D is used elsewhere in the browser. "We've made significant progress and are now able to present a Firefox browser completely rendered using Direct2D, making intensive usage of the GPU," or graphics processing unit, Schouten said. And because Cairo is used by other open-source software, other projects will benefit from the work, he added.

The Direct2D work is Mozilla's second hardware acceleration effort; the company also is working on one using a different hardware acceleration interface called OpenGL for mobile devices using Nvidia's Tegra chips, according to Mozilla.

This Mozilla demonstration of photos and Scalable Vector Graphics (SVG), with transparency and click-and-drag resizing, works more than twice as fast Direct2D graphics.

This Mozilla demonstration of photos and Scalable Vector Graphics (SVG), with transparency and click-and-drag resizing, works more than twice as fast Direct2D graphics.

(Credit: Screenshot by Stephen Shankland/CNET)

The interactive Web
Microsoft went out of its way to emphasize that the Direct2D and DirectWrite work will help existing Web pages without programmers having to change a line of code. Dean Hachamovitch, general manager of Internet Explorer, contrasted that to other hardware acceleration efforts including Native Client and O3D from Google and WebGL from Mozilla and the Khronos Group.

Native Client, O3D, and WebGL are part of a long list of developments designed to transform the Web into a foundation not just for static pages but also for interactive applications. Those technologies, though, require new programming skills and tools.

Mozilla, Google, Apple, and Opera have been pushing this interactive Web agenda, and Microsoft is showing signs of interest, too. However, for now, Microsoft emphasizes that Direct2D support will help the existing Web. But the browser makers have their eyes on interactive technology as well. Direct2D will help with complex sites that use 2D graphics interfaces such as SVG and Canvas, Mozilla said.

Added Schouten, "As Web sites become more graphically intense, dynamic graphics will start playing a larger role, especially in user interfaces."

Stephen Shankland writes about a wide range of technology and products, but has a particular focus on browsers and digital photography. He joined CNET News in 1998 and since then also has covered Google, Yahoo, servers, supercomputing, Linux and open-source software, and science. E-mail Stephen, follow him on Twitter at http://www.twitter.com/stshank, or contact him through Google Buzz.

Recent posts from Deep Tech
Lightroom plug-in helps avoid overlarge JPEGs
Airbus A380's lumbering airshow acrobatics (video)
Google fixes Chrome holes, seeks security reform
Yahoo Japan switches to Google search
Will phones and 3D Web boost new OpenGL?
LHC firing on all cylinders, but no Higgs boson yet
Farnborough: Where aviation struts and cuts deals
Chrome dev too stable? Try new Chrome Canary
advertisement
Click Here
CNET River
  • loricnet: I've been told I have a memory like a white board. I guess the markers are at the beach. "The science of forgetting," http://bit.ly/bpZIf2

  • mollywood: . @ShoKilla I ran out of characters for the #excusesexcuses hashtag. ;)

  • Josh: Laptop slipped out of bag, landed screen side down. Nothing broken, but I have yet to turn it on. Secretly hoping its an excuse to upgrade

  • mollywood: I'll be on CNBC's Squawk on the Street tomorrow, from the Wall St studio, @ 10:30 ET. Had to go buy a new business Betty Calvin Klein dress!

  • nicole: Got full access to both Flipboard and Hulu+ this week! It's like the Web deities looked at me and said "Yes, that one. She's nerdy enough."

  • antgoo: Nothing like getting lost in your own hometown, jeez! It's a good thing I've always got at GPS device or two on me.

  • briancooley: I like old airports and dying transit depots. They have a wan romance. And urine. http://twitpic.com/29vcnr

  • jdolcourt: Mozilla fixes top three complaints for Firefox Home for iPhone, Firefox Sync - http://bit.ly/dupucT

  • jdolcourt: If you've got it, let us know what you think! RT @cnet BlackBerry App World 2.0 beta arrives for some - http://bit.ly/acyuPy

  • b1g1nj4p4n: it's horror story time in the #blackhat press room. in years past, the journalist's LAN got hacked BY OTHER JOURNOS. what a dick move.

  • waynec_sf: RT @cnet Car Tech Live 179: How to steal a Nissan Leaf (podcast) | Car Tech Live Podcast - CNET Bl.. http://bit.ly/bDpkCC

  • waynec_sf: RT @cnet Mitsubishi i-Miev in the city | The Car Tech blog - CNET Reviews http://bit.ly/97BKZp

  • Rafe: Good to know: "Loose wires attached to" ATM may be a sign it's been hacked. Thanks for the tip! http://bit.ly/d6h7iZ

  • briancooley: Car Tech Live 179 is up, wherein we figure out if you can really afford a Chevy Volt or Nissan Leaf: http://bit.ly/atnSL8

  • WeirdEaredJas: RT @cnet Do unto others--Jasmine's Tech Dos & Don'ts | MP3 Insider - CNET Reviews http://bit.ly/azOMeH

  • jdolcourt: Aw, thanks, @alexjnath! @raygun01 and @jeffbakalar make it easy.

  • declanm: At #BlackHat, ACLU throwing offstrip '80s party from 5-8pm (aclunv.org). #EFF #Defcon party with nerdcore band (dualcoremusic.com) after.

  • jdolcourt: RT @cnet Most Google services blocked in China again - http://bit.ly/baUiHm

Netflix delights studios with big checks

The rental service often said that once the streaming-movie business took off, it would mean bigger bucks for the studios. That transition has begun.

Amazon unveils new Kindles

The online retailer will ship a smaller, lighter $189 Kindle with new features on August 27. A Wi-Fi-only version will cost only $139.

About Deep Tech

Stephen Shankland, who's covered the computing industry since 1998 and was a science reporter before that, here delves into a wide range of technology trends and offers hands-on tests. His particular interests include Web browsers, cameras, standards, research, science, and start-ups.

Add this feed to your online news reader

Deep Tech topics

advertisement
Click Here
advertisement

Inside CNET News

Scroll Left Scroll Right