Closed Bug 590335 Opened 13 years ago Closed 12 years ago

add "turn d2d off" pref

Categories

(Core :: Graphics, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- beta5+

People

(Reporter: joe, Assigned: joe)

References

Details

Attachments

(1 file)

We need a new about:config pref that makes it a lot easier to force off Direct2D.
This patch adds the pref gfx.direct2d.disabled, which is set to false by default, but can be toggled to true to disable the automatic use of d2d. Users can still use mozilla.widget.render-mode to select a rendering mode manually.
Attachment #469117 - Flags: review?(bas.schouten)
Comment on attachment 469117 [details] [diff] [review]
add gfx.direct2d.disabled pref

># HG changeset patch
># Parent cca13a1397f8d70257b151ac5cf5dfb0dbcac1ba
>diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp
>--- a/gfx/thebes/gfxWindowsPlatform.cpp
>+++ b/gfx/thebes/gfxWindowsPlatform.cpp
>@@ -222,17 +222,22 @@ gfxWindowsPlatform::gfxWindowsPlatform()
>     ::GetVersionExA(&versionInfo);
>     bool isVistaOrHigher = versionInfo.dwMajorVersion >= 6;
> 
> #ifdef CAIRO_HAS_D2D_SURFACE
>     NS_RegisterMemoryReporter(new D2DCacheReporter());
>     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;
I wonder if we really need this, logic would dictate GetBoolPref doesn't touch d2dDisabled if it fails.
Attachment #469117 - Flags: review?(bas.schouten) → review+
blocking2.0: --- → beta5+
Blocks: 587857
http://hg.mozilla.org/mozilla-central/rev/5d174cb918fe
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.