Bug 1289873 - correction made for compositing failure ids in failure path not showing up draft
authoreyim <eyim@mozilla.com>
Fri, 29 Jul 2016 11:41:33 -0400
changeset 394307 26435cd35057864566014defe2b8ce1c6f8f4e7d
parent 393325 25c8ecf632106f0b980b652b653b9e97b0686569
child 526793 c6dc115c123584ecbfc0851febae8a1ff23ada9f
push id24552
push userbmo:eyim@mozilla.com
push dateFri, 29 Jul 2016 15:45:25 +0000
bugs1289873
milestone50.0a1
Bug 1289873 - correction made for compositing failure ids in failure path not showing up MozReview-Commit-ID: CRIJwplDBYS
gfx/layers/ipc/CompositorBridgeParent.cpp
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1597,30 +1597,46 @@ CompositorBridgeParent::NewCompositor(co
       compositor = new CompositorD3D9(this, mWidget);
 #endif
     }
     nsCString failureReason;
     if (compositor && compositor->Initialize(&failureReason)) {
       if (failureReason.IsEmpty()){
         failureReason = "SUCCESS";
       }
-      if (compositor->GetBackendType() == LayersBackend::LAYERS_OPENGL){
+
+      // should only report success here
+      if (aBackendHints[i] == LayersBackend::LAYERS_OPENGL){
         Telemetry::Accumulate(Telemetry::OPENGL_COMPOSITING_FAILURE_ID, failureReason);
       }
 #ifdef XP_WIN
-      else if (compositor->GetBackendType() == LayersBackend::LAYERS_D3D9){
+      else if (aBackendHints[i] == LayersBackend::LAYERS_D3D9){
         Telemetry::Accumulate(Telemetry::D3D9_COMPOSITING_FAILURE_ID, failureReason);
       }
-      else if (compositor->GetBackendType() == LayersBackend::LAYERS_D3D11){
+      else if (aBackendHints[i] == LayersBackend::LAYERS_D3D11){
         Telemetry::Accumulate(Telemetry::D3D11_COMPOSITING_FAILURE_ID, failureReason);
       }
 #endif
+
       compositor->SetCompositorID(mCompositorID);
       return compositor;
     }
+
+    // report any failure reasons here
+    if (aBackendHints[i] == LayersBackend::LAYERS_OPENGL){
+      Telemetry::Accumulate(Telemetry::OPENGL_COMPOSITING_FAILURE_ID, failureReason);
+    }
+#ifdef XP_WIN
+    else if (aBackendHints[i] == LayersBackend::LAYERS_D3D9){
+      Telemetry::Accumulate(Telemetry::D3D9_COMPOSITING_FAILURE_ID, failureReason);
+    }
+    else if (aBackendHints[i] == LayersBackend::LAYERS_D3D11){
+      Telemetry::Accumulate(Telemetry::D3D11_COMPOSITING_FAILURE_ID, failureReason);
+    }
+#endif
   }
 
   return nullptr;
 }
 
 PLayerTransactionParent*
 CompositorBridgeParent::AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
                                                      const uint64_t& aId,