Bug 1295742 - Add gfxCriticalNote for driver reset. r=jerry, r=dvander

This commit is contained in:
Ethan Lin 2016-08-25 02:17:00 -04:00
parent 1b607c3e60
commit d2db92ebce
2 changed files with 11 additions and 2 deletions

View File

@ -976,12 +976,14 @@ gfxWindowsPlatform::SchedulePaintIfDeviceReset()
return;
}
gfxCriticalNote << "(gfxWindowsPlatform) Detected device reset: " << (int)resetReason;
// Trigger an ::OnPaint for each window.
::EnumThreadWindows(GetCurrentThreadId(),
InvalidateWindowForDeviceReset,
0);
gfxCriticalNote << "Detected rendering device reset on refresh: " << (int)resetReason;
gfxCriticalNote << "(gfxWindowsPlatform) Finished device reset.";
}
void

View File

@ -170,11 +170,18 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel)
if (mozilla::ipc::MessageChannel::IsSpinLoopActive() && mPainting)
return false;
if (gfxWindowsPlatform::GetPlatform()->DidRenderingDeviceReset()) {
DeviceResetReason resetReason = DeviceResetReason::OK;
if (gfxWindowsPlatform::GetPlatform()->DidRenderingDeviceReset(&resetReason)) {
gfxCriticalNote << "(nsWindow) Detected device reset: " << (int)resetReason;
gfxWindowsPlatform::GetPlatform()->UpdateRenderMode();
EnumAllWindows([] (nsWindow* aWindow) -> void {
aWindow->OnRenderingDeviceReset();
});
gfxCriticalNote << "(nsWindow) Finished device reset.";
return false;
}