From d3e6013f97aee6f286b6939d7b06cbd4ce53d5df Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 23 Sep 2014 17:57:14 -0400 Subject: [PATCH] Bug 1066139 - Put stereo video behind a pref (off by default). r=Bas --- gfx/layers/d3d9/DeviceManagerD3D9.cpp | 25 ++++++++++++++----------- gfx/thebes/gfxPrefs.h | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gfx/layers/d3d9/DeviceManagerD3D9.cpp b/gfx/layers/d3d9/DeviceManagerD3D9.cpp index d576dd77d8e5..167b953ac86a 100644 --- a/gfx/layers/d3d9/DeviceManagerD3D9.cpp +++ b/gfx/layers/d3d9/DeviceManagerD3D9.cpp @@ -17,6 +17,7 @@ #include "gfxWindowsPlatform.h" #include "TextureD3D9.h" #include "mozilla/gfx/Point.h" +#include "gfxPrefs.h" namespace mozilla { namespace layers { @@ -201,18 +202,20 @@ DeviceManagerD3D9::Init() return false; } - /* Create an Nv3DVUtils instance */ - if (!mNv3DVUtils) { - mNv3DVUtils = new Nv3DVUtils(); - if (!mNv3DVUtils) { - NS_WARNING("Could not create a new instance of Nv3DVUtils.\n"); - } - } + if (gfxPrefs::StereoVideoEnabled()) { + /* Create an Nv3DVUtils instance */ + if (!mNv3DVUtils) { + mNv3DVUtils = new Nv3DVUtils(); + if (!mNv3DVUtils) { + NS_WARNING("Could not create a new instance of Nv3DVUtils.\n"); + } + } - /* Initialize the Nv3DVUtils object */ - if (mNv3DVUtils) { - mNv3DVUtils->Initialize(); - } + /* Initialize the Nv3DVUtils object */ + if (mNv3DVUtils) { + mNv3DVUtils->Initialize(); + } + } HMODULE d3d9 = LoadLibraryW(L"d3d9.dll"); decltype(Direct3DCreate9)* d3d9Create = (decltype(Direct3DCreate9)*) diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index 852288834e33..2f6189c85ffa 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -286,6 +286,7 @@ private: DECL_GFX_PREF(Once, "webgl.force-layers-readback", WebGLForceLayersReadback, bool, false); + DECL_GFX_PREF(Once, "layers.stereo-video.enabled", StereoVideoEnabled, bool, false); public: // Manage the singleton: static gfxPrefs& GetSingleton()