зеркало из https://github.com/mozilla/pjs.git
Bug 636870 - Using webgl on optimus hardware causes instant crash [part1] (r=jmuizelaar, a=blocker).
This commit is contained in:
Родитель
989f3dec93
Коммит
99cf6e25bf
|
@ -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);
|
||||
|
|
|
@ -825,3 +825,9 @@ gfxWindowsPlatform::FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aP
|
|||
gfxTextRunWordCache::Flush();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
gfxWindowsPlatform::IsOptimus()
|
||||
{
|
||||
return GetModuleHandleA("nvumdshim.dll");
|
||||
}
|
||||
|
|
|
@ -255,6 +255,8 @@ public:
|
|||
FT_Library GetFTLibrary();
|
||||
#endif
|
||||
|
||||
static bool IsOptimus();
|
||||
|
||||
protected:
|
||||
RenderMode mRenderMode;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче