Bug 1235407 - Part 2: Add ability to force device resets through gfxWindowsPlatform. r=milan

This commit is contained in:
Bas Schouten 2015-12-30 01:30:47 +01:00
parent 3d1ad5faa9
commit 667d7a5517
3 changed files with 15 additions and 0 deletions

View File

@ -132,6 +132,7 @@ enum class DeviceResetReason
DRIVER_ERROR,
INVALID_CALL,
OUT_OF_MEMORY,
FORCED_RESET,
UNKNOWN
};

View File

@ -555,6 +555,15 @@ gfxWindowsPlatform::UpdateRenderMode()
}
}
void
gfxWindowsPlatform::ForceDeviceReset(ForcedDeviceResetReason aReason)
{
Telemetry::Accumulate(Telemetry::FORCED_DEVICE_RESET_REASON, uint32_t(aReason));
mDeviceResetReason = DeviceResetReason::FORCED_RESET;
mHasDeviceReset = true;
}
mozilla::gfx::BackendType
gfxWindowsPlatform::GetContentBackendFor(mozilla::layers::LayersBackend aLayers)
{

View File

@ -149,6 +149,11 @@ public:
*/
void UpdateRenderMode();
/**
* Forces all GPU resources to be recreated on the next frame.
*/
void ForceDeviceReset(ForcedDeviceResetReason aReason);
/**
* Verifies a D2D device is present and working, will attempt to create one
* it is non-functional or non-existant.