Bug 1292273 - Add logs to record the failure of compositor creation. r=dvander, a=ritu
☠☠ backed out by 90c412c90291 ☠ ☠
authorKevin Chen <kechen@mozilla.com>
Tue, 25 Oct 2016 19:26:00 -0400
changeset 350810 5ebcf218f6784fc8cd376c3f3071b6d1aa17e302
parent 350809 f43ffbca8d4db9f66988d07bd5ed93c742f2cd2e
child 350811 b5b9398d03100e6610d17de9b1fa502a16c7a740
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, ritu
bugs1292273
milestone50.0
Bug 1292273 - Add logs to record the failure of compositor creation. r=dvander, a=ritu
gfx/layers/d3d11/CompositorD3D11.cpp
gfx/layers/ipc/CompositorBridgeParent.cpp
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -201,16 +201,17 @@ CompositorD3D11::Initialize(nsCString* c
   ScopedGfxFeatureReporter reporter("D3D11 Layers");
 
   MOZ_ASSERT(gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING));
 
   HRESULT hr;
 
   mDevice = DeviceManagerD3D11::Get()->GetCompositorDevice();
   if (!mDevice) {
+    gfxCriticalNote << "[D3D11] failed to get compositor device.";
     *out_failureReason = "FEATURE_FAILURE_D3D11_NO_DEVICE";
     return false;
   }
 
   mDevice->GetImmediateContext(getter_AddRefs(mContext));
 
   if (!mContext) {
     gfxCriticalNote << "[D3D11] failed to get immediate context";
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1593,23 +1593,29 @@ CompositorBridgeParent::NewCompositor(co
     nsCString failureReason;
     if (compositor && compositor->Initialize(&failureReason)) {
       if (failureReason.IsEmpty()){
         failureReason = "SUCCESS";
       }
 
       // should only report success here
       if (aBackendHints[i] == LayersBackend::LAYERS_OPENGL){
+        gfxCriticalNote << "[OPENGL] Failed to init compositor with reason: "
+                        << failureReason.get();
         Telemetry::Accumulate(Telemetry::OPENGL_COMPOSITING_FAILURE_ID, failureReason);
       }
 #ifdef XP_WIN
       else if (aBackendHints[i] == LayersBackend::LAYERS_D3D9){
+        gfxCriticalNote << "[D3D9] Failed to init compositor with reason: "
+                        << failureReason.get();
         Telemetry::Accumulate(Telemetry::D3D9_COMPOSITING_FAILURE_ID, failureReason);
       }
       else if (aBackendHints[i] == LayersBackend::LAYERS_D3D11){
+        gfxCriticalNote << "[D3D11] Failed to init compositor with reason: "
+                        << failureReason.get();
         Telemetry::Accumulate(Telemetry::D3D11_COMPOSITING_FAILURE_ID, failureReason);
       }
 #endif
 
       compositor->SetCompositorID(mCompositorID);
       return compositor;
     }
 
@@ -2278,16 +2284,17 @@ Maybe<TextureFactoryIdentifier>
 CompositorBridgeParent::ResetCompositorImpl(const nsTArray<LayersBackend>& aBackendHints)
 {
   if (!mLayerManager) {
     return Nothing();
   }
 
   RefPtr<Compositor> compositor = NewCompositor(aBackendHints);
   if (!compositor) {
+    gfxCriticalNote << "Failed to reset compositor.";
     return Nothing();
   }
 
   // Don't bother changing from basic->basic.
   if (mCompositor &&
       mCompositor->GetBackendType() == LayersBackend::LAYERS_BASIC &&
       compositor->GetBackendType() == LayersBackend::LAYERS_BASIC)
   {