Platform/GFX/Direct2DDemo: Difference between revisions

From MozillaWiki
< Platform‎ | GFX
Jump to navigation Jump to search
(Created page with '= Demoing Direct2D = Since there are occasions where people might want to demonstrate Direct2D browser hardware acceleration. I'll briefly describe here how to do this. '''Requ…')
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
'''Required Hardware'''
'''Required Hardware'''


You'll need to make sure you have DX10 compatible hardware or higher. DX9 hardware may work, but performance will vary significantly. Onboard graphics chipsets may also not function quite as you'd like them to. nVidia or ATI hardware is at this point the best hardware to demo this on. In order to check for recent enough drivers and DX 10 support, go to Run, and execute 'dxdiag'. Under the 'display' tab it should display DDI: 10 (or higher), and on windows 7 it should display WDDM: 1.1
You'll need to make sure you have DX10 compatible hardware or higher. DX9 hardware may work, but performance will vary significantly. Onboard graphics chipsets may also not function quite as you'd like them to. NVIDIA or ATI hardware is at this point the best hardware to demo this on. In order to check for recent enough drivers and DX 10 support, go to Run, and execute 'dxdiag'. Under the 'display' tab it should display DDI: 10 (or higher), and on windows 7 it should display WDDM: 1.1


'''Installing a Build'''
'''Installing a Build'''


Right now I have the latest build stored [http://www.bassified.nl/firefox-3.7a1pre.en-US.win32.d2d.2009.12.3.zip on my server]. Until we have the DirectX SDK installed on the try servers. This is a build without PGO, with a simple --disable-debug --enable-release mozconfig. Its performance should not be compared to normal build server builds at this point.
Mozilla 2.0 (mozilla-central) builds contain support for Direct2D and DirectWrite. As of August 17, 2010, Direct2D and DirectWrite were turned on by default for DirectX 10 hardware.


'''Starting the build'''
'''Checking if you are running Direct2D'''


The best way to start is is to just run the firefox executable with a special d2d profile. (i.e. firefox -no-remote -P d2d) A second instance can then be ran in order to make comparisons on a different profile.
Look in 'about:support'. At or near the bottom, you will see an item that tells you whether Direct2D is enabled.


'''Using GDI'''
'''Using Direct2D if it is not turned on for you'''


To compare or demo the performance difference it's possible to use GDI in one of my builds. Create a separate profile for your GDI version. And for that profile set the 'font.engine.forcegdi' pref to true. Note that if you do this from about:config it will need a restart before it starts using GDI.
By default, Direct2D and DirectWrite are turned on for DirectX 10 hardware. If you want to try to force it on (check about:support to see if it worked), follow these steps:
 
# Enter 'about:config'
# Click through the warning, if necessary
# Enter render in the 'Filter' box
# Double-click on 'gfx.font_rendering.directwrite.enabled' to set it to true
# Double-click on 'mozilla.widget.render-mode' and change its value to 6
# Restart the browser
 
Special note: If you disable DirectWrite using this method, Direct2D will also be turned off.
 
'''Turning off Direct2D'''
 
If you suspect Direct2D has caused a bug, you can check by turning off Direct2D:
 
# Enter 'about:config'
# Click through the warning, if necessary
# Enter render in the 'Filter' box
# Double-click on 'mozilla.widget.render-mode' and change its value to 0
# Restart the browser
 
To revert to the default behaviour, change 'mozilla.widget.render-mode' to -1.


'''Some good sites'''
'''Some good sites'''

Latest revision as of 22:44, 19 August 2010

Demoing Direct2D

Since there are occasions where people might want to demonstrate Direct2D browser hardware acceleration. I'll briefly describe here how to do this.

Required Software

You need to be running either Windows 7 or Windows Vista with the Vista Platform update. Windows 7 is preferred because of it using WDDM1.1

Required Hardware

You'll need to make sure you have DX10 compatible hardware or higher. DX9 hardware may work, but performance will vary significantly. Onboard graphics chipsets may also not function quite as you'd like them to. NVIDIA or ATI hardware is at this point the best hardware to demo this on. In order to check for recent enough drivers and DX 10 support, go to Run, and execute 'dxdiag'. Under the 'display' tab it should display DDI: 10 (or higher), and on windows 7 it should display WDDM: 1.1

Installing a Build

Mozilla 2.0 (mozilla-central) builds contain support for Direct2D and DirectWrite. As of August 17, 2010, Direct2D and DirectWrite were turned on by default for DirectX 10 hardware.

Checking if you are running Direct2D

Look in 'about:support'. At or near the bottom, you will see an item that tells you whether Direct2D is enabled.

Using Direct2D if it is not turned on for you

By default, Direct2D and DirectWrite are turned on for DirectX 10 hardware. If you want to try to force it on (check about:support to see if it worked), follow these steps:

  1. Enter 'about:config'
  2. Click through the warning, if necessary
  3. Enter render in the 'Filter' box
  4. Double-click on 'gfx.font_rendering.directwrite.enabled' to set it to true
  5. Double-click on 'mozilla.widget.render-mode' and change its value to 6
  6. Restart the browser

Special note: If you disable DirectWrite using this method, Direct2D will also be turned off.

Turning off Direct2D

If you suspect Direct2D has caused a bug, you can check by turning off Direct2D:

  1. Enter 'about:config'
  2. Click through the warning, if necessary
  3. Enter render in the 'Filter' box
  4. Double-click on 'mozilla.widget.render-mode' and change its value to 0
  5. Restart the browser

To revert to the default behaviour, change 'mozilla.widget.render-mode' to -1.

Some good sites

Some good sites that show off the advantages of hardware acceleration well are the following: