mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1254400 - Handle device reset for d3d9. r=dvander
--HG-- extra : commitid : 8yHPSR3Z73s
This commit is contained in:
parent
eb9d46b90f
commit
97773ba583
@ -670,7 +670,9 @@ CompositorD3D9::FailedToResetDevice() {
|
|||||||
// 10 is a totally arbitrary number that we may want to increase or decrease
|
// 10 is a totally arbitrary number that we may want to increase or decrease
|
||||||
// depending on how things behave in the wild.
|
// depending on how things behave in the wild.
|
||||||
if (mFailedResetAttempts > 10) {
|
if (mFailedResetAttempts > 10) {
|
||||||
MOZ_CRASH("GFX: Unable to get a working D3D9 Compositor");
|
mFailedResetAttempts = 0;
|
||||||
|
gfxWindowsPlatform::GetPlatform()->D3D9DeviceReset();
|
||||||
|
gfxWarning() << "[D3D9] Unable to get a working D3D9 Compositor";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,7 +904,7 @@ TextureHostD3D9::UpdatedInternal(const nsIntRegion* aRegion)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!mTextureSource->UpdateFromTexture(mTexture, regionToUpdate)) {
|
if (!mTextureSource->UpdateFromTexture(mTexture, regionToUpdate)) {
|
||||||
gfxCriticalError() << "[D3D9] DataTextureSourceD3D9::UpdateFromTexture failed";
|
gfxWarning() << "[D3D9] DataTextureSourceD3D9::UpdateFromTexture failed";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ protected:
|
|||||||
TextureSourceD3D9* mPreviousHost;
|
TextureSourceD3D9* mPreviousHost;
|
||||||
TextureSourceD3D9* mNextHost;
|
TextureSourceD3D9* mNextHost;
|
||||||
// The device manager that created our textures.
|
// The device manager that created our textures.
|
||||||
DeviceManagerD3D9* mCreatingDeviceManager;
|
RefPtr<DeviceManagerD3D9> mCreatingDeviceManager;
|
||||||
|
|
||||||
StereoMode mStereoMode;
|
StereoMode mStereoMode;
|
||||||
RefPtr<IDirect3DTexture9> mTexture;
|
RefPtr<IDirect3DTexture9> mTexture;
|
||||||
|
@ -377,6 +377,7 @@ gfxWindowsPlatform::gfxWindowsPlatform()
|
|||||||
, mAcceleration(FeatureStatus::Unused)
|
, mAcceleration(FeatureStatus::Unused)
|
||||||
, mD3D11Status(FeatureStatus::Unused)
|
, mD3D11Status(FeatureStatus::Unused)
|
||||||
, mD2D1Status(FeatureStatus::Unused)
|
, mD2D1Status(FeatureStatus::Unused)
|
||||||
|
, mHasD3D9DeviceReset(false)
|
||||||
{
|
{
|
||||||
mUseClearTypeForDownloadableFonts = UNINITIALIZED_VALUE;
|
mUseClearTypeForDownloadableFonts = UNINITIALIZED_VALUE;
|
||||||
mUseClearTypeAlways = UNINITIALIZED_VALUE;
|
mUseClearTypeAlways = UNINITIALIZED_VALUE;
|
||||||
@ -483,6 +484,7 @@ gfxWindowsPlatform::HandleDeviceReset()
|
|||||||
// will be recomputed by InitializeDevices().
|
// will be recomputed by InitializeDevices().
|
||||||
mHasDeviceReset = false;
|
mHasDeviceReset = false;
|
||||||
mHasFakeDeviceReset = false;
|
mHasFakeDeviceReset = false;
|
||||||
|
mHasD3D9DeviceReset = false;
|
||||||
mCompositorD3D11TextureSharingWorks = false;
|
mCompositorD3D11TextureSharingWorks = false;
|
||||||
mDeviceResetReason = DeviceResetReason::OK;
|
mDeviceResetReason = DeviceResetReason::OK;
|
||||||
|
|
||||||
@ -996,6 +998,9 @@ gfxWindowsPlatform::DidRenderingDeviceReset(DeviceResetReason* aResetReason)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mHasD3D9DeviceReset) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (XRE_IsParentProcess() && gfxPrefs::DeviceResetForTesting()) {
|
if (XRE_IsParentProcess() && gfxPrefs::DeviceResetForTesting()) {
|
||||||
TestDeviceReset((DeviceResetReason)gfxPrefs::DeviceResetForTesting());
|
TestDeviceReset((DeviceResetReason)gfxPrefs::DeviceResetForTesting());
|
||||||
if (aResetReason) {
|
if (aResetReason) {
|
||||||
@ -1392,6 +1397,11 @@ gfxWindowsPlatform::GetD3D9Device()
|
|||||||
return manager ? manager->device() : nullptr;
|
return manager ? manager->device() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gfxWindowsPlatform::D3D9DeviceReset() {
|
||||||
|
mHasD3D9DeviceReset = true;
|
||||||
|
}
|
||||||
|
|
||||||
DeviceManagerD3D9*
|
DeviceManagerD3D9*
|
||||||
gfxWindowsPlatform::GetD3D9DeviceManager()
|
gfxWindowsPlatform::GetD3D9DeviceManager()
|
||||||
{
|
{
|
||||||
|
@ -212,6 +212,7 @@ public:
|
|||||||
void OnDeviceManagerDestroy(mozilla::layers::DeviceManagerD3D9* aDeviceManager);
|
void OnDeviceManagerDestroy(mozilla::layers::DeviceManagerD3D9* aDeviceManager);
|
||||||
mozilla::layers::DeviceManagerD3D9* GetD3D9DeviceManager();
|
mozilla::layers::DeviceManagerD3D9* GetD3D9DeviceManager();
|
||||||
IDirect3DDevice9* GetD3D9Device();
|
IDirect3DDevice9* GetD3D9Device();
|
||||||
|
void D3D9DeviceReset();
|
||||||
ID3D11Device *GetD3D11ContentDevice();
|
ID3D11Device *GetD3D11ContentDevice();
|
||||||
|
|
||||||
// Create a D3D11 device to be used for DXVA decoding.
|
// Create a D3D11 device to be used for DXVA decoding.
|
||||||
@ -333,6 +334,7 @@ private:
|
|||||||
bool mHasDeviceReset;
|
bool mHasDeviceReset;
|
||||||
bool mHasFakeDeviceReset;
|
bool mHasFakeDeviceReset;
|
||||||
bool mCompositorD3D11TextureSharingWorks;
|
bool mCompositorD3D11TextureSharingWorks;
|
||||||
|
mozilla::Atomic<bool> mHasD3D9DeviceReset;
|
||||||
DeviceResetReason mDeviceResetReason;
|
DeviceResetReason mDeviceResetReason;
|
||||||
|
|
||||||
RefPtr<mozilla::layers::ReadbackManagerD3D11> mD3D11ReadbackManager;
|
RefPtr<mozilla::layers::ReadbackManagerD3D11> mD3D11ReadbackManager;
|
||||||
|
Loading…
Reference in New Issue
Block a user