Bug 590335 - Add a pref to unconditionally disable Direct2D. r=bas a=blocking2.0:beta5+

This commit is contained in:
Joe Drew 2010-08-27 22:44:37 -04:00
parent e20e8fb61d
commit 177c57fe4b
2 changed files with 9 additions and 2 deletions

View File

@ -232,7 +232,12 @@ gfxWindowsPlatform::gfxWindowsPlatform()
NS_RegisterMemoryReporter(new D2DVRAMReporter());
mD2DDevice = NULL;
if (isVistaOrHigher) {
PRBool d2dDisabled = PR_FALSE;
nsresult rv = pref->GetBoolPref("gfx.direct2d.disabled", &d2dDisabled);
if (NS_FAILED(rv))
d2dDisabled = PR_FALSE;
if (isVistaOrHigher && !d2dDisabled) {
// We need a DWriteFactory to work.
HMODULE d3d10module = LoadLibraryA("d3d10_1.dll");
D3D10CreateDevice1Func createD3DDevice = (D3D10CreateDevice1Func)
@ -282,7 +287,6 @@ gfxWindowsPlatform::gfxWindowsPlatform()
#endif
#ifdef CAIRO_HAS_DWRITE_FONT
nsresult rv;
PRBool useDirectWrite = PR_FALSE;
rv = pref->GetBoolPref(

View File

@ -3193,6 +3193,9 @@ pref("layers.accelerate-none", false);
#ifdef XP_WIN
#ifndef WINCE
// Whether to disable the automatic detection and use of direct2d.
pref("gfx.direct2d.disabled", false);
pref("layers.prefer-opengl", false);
#endif
#endif