Bug 1189715 - verify that reference draw target is created after device reset and log failure in gfxWindowsPlatform::UpdateRenderMode. r=milan, a=lizzard
authorLee Salzman <lsalzman@mozilla.com>
Thu, 24 Mar 2016 14:42:50 -0400
changeset 323837 6adef622c36b1ff4d388e1199f1ee328651ac616
parent 323836 c774432aac6d549fd420103f314694608a19e4d6
child 323838 b7ac08e2f3abca76cd06f9a151a95dec3531b89f
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmilan, lizzard
bugs1189715
milestone47.0a2
Bug 1189715 - verify that reference draw target is created after device reset and log failure in gfxWindowsPlatform::UpdateRenderMode. r=milan, a=lizzard
gfx/thebes/gfxWindowsPlatform.cpp
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -523,16 +523,26 @@ gfxWindowsPlatform::UpdateRenderMode()
 {
   bool didReset = HandleDeviceReset();
 
   UpdateBackendPrefs();
 
   if (didReset) {
     mScreenReferenceDrawTarget =
       CreateOffscreenContentDrawTarget(IntSize(1, 1), SurfaceFormat::B8G8R8A8);
+    if (!mScreenReferenceDrawTarget) {
+      gfxCriticalNote << "Failed to update reference draw target after device reset"
+                      << ", D3D11 device:" << hexa(Factory::GetDirect3D11Device())
+                      << ", D3D11 status:" << FeatureStatusToString(GetD3D11Status())
+                      << ", D2D1 device:" << hexa(Factory::GetD2D1Device())
+                      << ", D2D1 status:" << FeatureStatusToString(GetD2D1Status())
+                      << ", content:" << int(GetDefaultContentBackend())
+                      << ", compositor:" << int(GetCompositorBackend());
+      MOZ_CRASH("GFX: Failed to update reference draw target after device reset");
+    }
   }
 }
 
 void
 gfxWindowsPlatform::ForceDeviceReset(ForcedDeviceResetReason aReason)
 {
   Telemetry::Accumulate(Telemetry::FORCED_DEVICE_RESET_REASON, uint32_t(aReason));