diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index e5386619a773..3887d5252ac1 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -721,8 +721,16 @@ WebGLContext::CreateAndInitGL(bool forceEnabled, if (useEGL) return CreateAndInitGLWith(CreateGLWithEGL, baseCaps, flags, out_failReasons); - if (CreateAndInitGLWith(CreateGLWithNative, baseCaps, flags, out_failReasons)) - return true; + bool tryNativeGL = true; +#ifdef XP_WIN + if (gfxPrefs::WebGLDisableWGL()) { + tryNativeGL = false; + } +#endif + if (tryNativeGL) { + if (CreateAndInitGLWith(CreateGLWithNative, baseCaps, flags, out_failReasons)) + return true; + } } ////// diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index de3b8c95b2f2..d5f9353e8d10 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -441,6 +441,7 @@ private: DECL_GFX_PREF(Live, "webgl.can-lose-context-in-foreground", WebGLCanLoseContextInForeground, bool, true); DECL_GFX_PREF(Live, "webgl.default-no-alpha", WebGLDefaultNoAlpha, bool, false); DECL_GFX_PREF(Live, "webgl.disable-angle", WebGLDisableANGLE, bool, false); + DECL_GFX_PREF(Live, "webgl.disable-wgl", WebGLDisableWGL, bool, false); DECL_GFX_PREF(Live, "webgl.disable-extensions", WebGLDisableExtensions, bool, false); DECL_GFX_PREF(Live, "webgl.dxgl.enabled", WebGLDXGLEnabled, bool, false); DECL_GFX_PREF(Live, "webgl.dxgl.needs-finish", WebGLDXGLNeedsFinish, bool, false); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 42f76da240a7..09515408b675 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4391,6 +4391,7 @@ pref("gl.multithreaded", true); pref("webgl.force-enabled", false); pref("webgl.disabled", false); pref("webgl.disable-angle", false); +pref("webgl.disable-wgl", false); pref("webgl.min_capability_mode", false); pref("webgl.disable-extensions", false); pref("webgl.msaa-force", false);