diff --git a/gfx/layers/d3d10/LayerManagerD3D10.cpp b/gfx/layers/d3d10/LayerManagerD3D10.cpp index f5d37eecdf6..a880bd9ad7f 100644 --- a/gfx/layers/d3d10/LayerManagerD3D10.cpp +++ b/gfx/layers/d3d10/LayerManagerD3D10.cpp @@ -116,12 +116,6 @@ LayerManagerD3D10::~LayerManagerD3D10() Destroy(); } -static bool -IsOptimus() -{ - return GetModuleHandleA("nvumdshim.dll"); -} - bool LayerManagerD3D10::Initialize() { @@ -254,7 +248,7 @@ LayerManagerD3D10::Initialize() // is broken on optimus devices. As a temporary solution we don't set it // there, the only way of reliably detecting we're on optimus is looking for // the DLL. See Bug 623807. - if (IsOptimus()) { + if (gfxWindowsPlatform::IsOptimus()) { swapDesc.Flags = 0; } else { swapDesc.Flags = DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE; @@ -536,7 +530,7 @@ LayerManagerD3D10::VerifyBufferSize() } mRTView = nsnull; - if (IsOptimus()) { + if (gfxWindowsPlatform::IsOptimus()) { mSwapChain->ResizeBuffers(1, rect.width, rect.height, DXGI_FORMAT_B8G8R8A8_UNORM, 0); diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index eda8a2be619..eb9217904ed 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -825,3 +825,9 @@ gfxWindowsPlatform::FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aP gfxTextRunWordCache::Flush(); } } + +bool +gfxWindowsPlatform::IsOptimus() +{ + return GetModuleHandleA("nvumdshim.dll"); +} diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h index 6cf741e64aa..e92c14bd1ff 100644 --- a/gfx/thebes/gfxWindowsPlatform.h +++ b/gfx/thebes/gfxWindowsPlatform.h @@ -255,6 +255,8 @@ public: FT_Library GetFTLibrary(); #endif + static bool IsOptimus(); + protected: RenderMode mRenderMode;