Bug 1029673 - Correctly report OMTC compositing in crash reports - r=Bas

This commit is contained in:
Benoit Jacob 2014-06-24 22:09:14 -04:00
parent 7dfa49820c
commit e19a022696
3 changed files with 15 additions and 1 deletions

View File

@ -15,6 +15,7 @@
#include "mozilla/layers/Effects.h"
#include "nsWindowsHelpers.h"
#include "gfxPrefs.h"
#include "gfxCrashReporterUtils.h"
#include "mozilla/EnumeratedArray.h"
@ -106,6 +107,10 @@ CompositorD3D11::~CompositorD3D11()
bool
CompositorD3D11::Initialize()
{
bool force = gfxPrefs::LayersAccelerationForceEnabled();
ScopedGfxFeatureReporter reporter("D3D11 Layers", force);
if (!gfxPlatform::CanUseDirect3D11()) {
NS_WARNING("Direct3D 11-accelerated layers are not supported on this system.");
return false;
@ -355,6 +360,7 @@ CompositorD3D11::Initialize()
DXGI_MWA_NO_WINDOW_CHANGES);
}
reporter.SetSuccessful();
return true;
}

View File

@ -16,6 +16,7 @@
#include "mozilla/layers/PCompositorParent.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "gfxPrefs.h"
#include "gfxCrashReporterUtils.h"
namespace mozilla {
namespace layers {
@ -39,6 +40,10 @@ CompositorD3D9::~CompositorD3D9()
bool
CompositorD3D9::Initialize()
{
bool force = gfxPrefs::LayersAccelerationForceEnabled();
ScopedGfxFeatureReporter reporter("D3D9 Layers", force);
if (!gfxPlatform::CanUseDirect3D9()) {
NS_WARNING("Direct3D 9-accelerated layers are not supported on this system.");
return false;
@ -56,6 +61,7 @@ CompositorD3D9::Initialize()
return false;
}
reporter.SetSuccessful();
return true;
}

View File

@ -179,7 +179,9 @@ CompositorOGL::CleanupResources()
bool
CompositorOGL::Initialize()
{
ScopedGfxFeatureReporter reporter("GL Layers", true);
bool force = gfxPrefs::LayersAccelerationForceEnabled();
ScopedGfxFeatureReporter reporter("GL Layers", force);
// Do not allow double initialization
NS_ABORT_IF_FALSE(mGLContext == nullptr, "Don't reinitialize CompositorOGL");