Bug 1295742 - Add gfxCriticalNote for driver reset. r=jerry, r=dvander
authorEthan Lin <ethlin@mozilla.com>
Thu, 25 Aug 2016 02:17:00 -0400
changeset 311790 396585308c33461063ee9ab01c7063c6e526874b
parent 311789 c9df0314cff2c3034c396b21a875b8fd80a712c2
child 311791 f6fddb22a8b58e5f3dcb6264e6765044b2e0d538
push id20417
push userryanvm@gmail.com
push dateTue, 30 Aug 2016 13:55:34 +0000
treeherderfx-team@b18c8bcdc116 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjerry, dvander
bugs1295742
milestone51.0a1
Bug 1295742 - Add gfxCriticalNote for driver reset. r=jerry, r=dvander
gfx/thebes/gfxWindowsPlatform.cpp
widget/windows/nsWindowGfx.cpp
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -971,22 +971,24 @@ gfxWindowsPlatform::SchedulePaintIfDevic
 {
   PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS);
 
   DeviceResetReason resetReason = DeviceResetReason::OK;
   if (!DidRenderingDeviceReset(&resetReason)) {
     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
 gfxWindowsPlatform::GetPlatformCMSOutputProfile(void* &mem, size_t &mem_size)
 {
     WCHAR str[MAX_PATH];
     DWORD size = MAX_PATH;
     BOOL res;
--- a/widget/windows/nsWindowGfx.cpp
+++ b/widget/windows/nsWindowGfx.cpp
@@ -165,21 +165,28 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t
 {
   // We never have reentrant paint events, except when we're running our RPC
   // windows event spin loop. If we don't trap for this, we'll try to paint,
   // but view manager will refuse to paint the surface, resulting is black
   // flashes on the plugin rendering surface.
   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;
   }
 
   // After we CallUpdateWindow to the child, occasionally a WM_PAINT message
   // is posted to the parent event loop with an empty update rect. Do a
   // dummy paint so that Windows stops dispatching WM_PAINT in an inifinite
   // loop. See bug 543788.
   if (IsPlugin()) {