Bug 711656 - report force-enabled features in crash reports - r=jrmuizel

Force-enabled features will be reported with a '!' instead of the usual '?' in AppNotes in crash reports.
This commit is contained in:
Benoit Jacob 2012-02-27 16:33:19 -05:00
Родитель 87072eac2f
Коммит d9d3f5553b
13 изменённых файлов: 27 добавлений и 24 удалений

Просмотреть файл

@ -362,8 +362,6 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
/*** end of early success return cases ***/ /*** end of early success return cases ***/
ScopedGfxFeatureReporter reporter("WebGL");
// At this point we know that the old context is not going to survive, even though we still don't // At this point we know that the old context is not going to survive, even though we still don't
// know if creating the new context will succeed. // know if creating the new context will succeed.
DestroyResourcesAndContext(); DestroyResourcesAndContext();
@ -386,6 +384,8 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
bool verbose = bool verbose =
Preferences::GetBool("webgl.verbose", false); Preferences::GetBool("webgl.verbose", false);
ScopedGfxFeatureReporter reporter("WebGL", forceEnabled);
if (disabled) if (disabled)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;

Просмотреть файл

@ -125,9 +125,9 @@ LayerManagerD3D10::~LayerManagerD3D10()
} }
bool bool
LayerManagerD3D10::Initialize() LayerManagerD3D10::Initialize(bool force)
{ {
ScopedGfxFeatureReporter reporter("D3D10 Layers"); ScopedGfxFeatureReporter reporter("D3D10 Layers", force);
HRESULT hr; HRESULT hr;

Просмотреть файл

@ -100,7 +100,7 @@ public:
* *
* \return True is initialization was succesful, false when it was not. * \return True is initialization was succesful, false when it was not.
*/ */
bool Initialize(); bool Initialize(bool force = false);
/* /*
* LayerManager implementation. * LayerManager implementation.

Просмотреть файл

@ -70,9 +70,9 @@ LayerManagerD3D9::~LayerManagerD3D9()
} }
bool bool
LayerManagerD3D9::Initialize() LayerManagerD3D9::Initialize(bool force)
{ {
ScopedGfxFeatureReporter reporter("D3D9 Layers"); ScopedGfxFeatureReporter reporter("D3D9 Layers", force);
/* XXX: this preference and blacklist code should move out of the layer manager */ /* XXX: this preference and blacklist code should move out of the layer manager */
bool forceAccelerate = bool forceAccelerate =

Просмотреть файл

@ -103,7 +103,7 @@ public:
* *
* \return True is initialization was succesful, false when it was not. * \return True is initialization was succesful, false when it was not.
*/ */
bool Initialize(); bool Initialize(bool force = false);
/* /*
* Sets the clipping region for this layer manager. This is important on * Sets the clipping region for this layer manager. This is important on

Просмотреть файл

@ -171,9 +171,9 @@ LayerManagerOGL::CreateContext()
} }
bool bool
LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext) LayerManagerOGL::Initialize(nsRefPtr<GLContext> aContext, bool force)
{ {
ScopedGfxFeatureReporter reporter("GL Layers"); ScopedGfxFeatureReporter reporter("GL Layers", force);
// Do not allow double intiailization // Do not allow double intiailization
NS_ABORT_IF_FALSE(mGLContext == nsnull, "Don't reiniailize layer managers"); NS_ABORT_IF_FALSE(mGLContext == nsnull, "Don't reiniailize layer managers");

Просмотреть файл

@ -106,11 +106,11 @@ public:
* *
* \return True is initialization was succesful, false when it was not. * \return True is initialization was succesful, false when it was not.
*/ */
bool Initialize() { bool Initialize(bool force = false) {
return Initialize(CreateContext()); return Initialize(CreateContext(), force);
} }
bool Initialize(nsRefPtr<GLContext> aContext); bool Initialize(nsRefPtr<GLContext> aContext, bool force = false);
/** /**
* Sets the clipping region for this layer manager. This is important on * Sets the clipping region for this layer manager. This is important on

Просмотреть файл

@ -103,10 +103,9 @@ ScopedGfxFeatureReporter::WriteAppNote(char statusChar)
} }
nsCAutoString featureString; nsCAutoString featureString;
featureString.AppendPrintf("%s%c%c", featureString.AppendPrintf("%s%c ",
mFeature, mFeature,
statusChar, statusChar);
statusChar == '?' ? ' ' : '\n');
if (!gFeaturesAlreadyReported->Contains(featureString)) { if (!gFeaturesAlreadyReported->Contains(featureString)) {
gFeaturesAlreadyReported->AppendElement(featureString); gFeaturesAlreadyReported->AppendElement(featureString);

Просмотреть файл

@ -53,9 +53,10 @@ namespace mozilla {
class NS_GFX ScopedGfxFeatureReporter class NS_GFX ScopedGfxFeatureReporter
{ {
public: public:
ScopedGfxFeatureReporter(const char *aFeature) : mFeature(aFeature), mStatusChar('-') ScopedGfxFeatureReporter(const char *aFeature, bool force = false)
: mFeature(aFeature), mStatusChar('-')
{ {
WriteAppNote('?'); WriteAppNote(force ? '!' : '?');
} }
~ScopedGfxFeatureReporter() { ~ScopedGfxFeatureReporter() {
WriteAppNote(mStatusChar); WriteAppNote(mStatusChar);

Просмотреть файл

@ -501,7 +501,7 @@ gfxWindowsPlatform::VerifyD2DDevice(bool aAttemptForce)
mD2DDevice = nsnull; mD2DDevice = nsnull;
} }
mozilla::ScopedGfxFeatureReporter reporter("D2D"); mozilla::ScopedGfxFeatureReporter reporter("D2D", aAttemptForce);
HMODULE d3d10module = LoadLibraryA("d3d10_1.dll"); HMODULE d3d10module = LoadLibraryA("d3d10_1.dll");
D3D10CreateDevice1Func createD3DDevice = (D3D10CreateDevice1Func) D3D10CreateDevice1Func createD3DDevice = (D3D10CreateDevice1Func)

Просмотреть файл

@ -3237,7 +3237,7 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
if (!prefs.mPreferD3D9 && !prefs.mPreferOpenGL) { if (!prefs.mPreferD3D9 && !prefs.mPreferOpenGL) {
nsRefPtr<mozilla::layers::LayerManagerD3D10> layerManager = nsRefPtr<mozilla::layers::LayerManagerD3D10> layerManager =
new mozilla::layers::LayerManagerD3D10(this); new mozilla::layers::LayerManagerD3D10(this);
if (layerManager->Initialize()) { if (layerManager->Initialize(prefs.mForceAcceleration)) {
mLayerManager = layerManager; mLayerManager = layerManager;
} }
} }
@ -3246,7 +3246,7 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
if (!prefs.mPreferOpenGL && !mLayerManager && sAllowD3D9) { if (!prefs.mPreferOpenGL && !mLayerManager && sAllowD3D9) {
nsRefPtr<mozilla::layers::LayerManagerD3D9> layerManager = nsRefPtr<mozilla::layers::LayerManagerD3D9> layerManager =
new mozilla::layers::LayerManagerD3D9(this); new mozilla::layers::LayerManagerD3D9(this);
if (layerManager->Initialize()) { if (layerManager->Initialize(prefs.mForceAcceleration)) {
mLayerManager = layerManager; mLayerManager = layerManager;
} }
} }

Просмотреть файл

@ -115,6 +115,7 @@ nsBaseWidget::nsBaseWidget()
, mBorderStyle(eBorderStyle_none) , mBorderStyle(eBorderStyle_none)
, mOnDestroyCalled(false) , mOnDestroyCalled(false)
, mUseAcceleratedRendering(false) , mUseAcceleratedRendering(false)
, mForceLayersAcceleration(false)
, mTemporarilyUseBasicLayerManager(false) , mTemporarilyUseBasicLayerManager(false)
, mBounds(0,0,0,0) , mBounds(0,0,0,0)
, mOriginalBounds(nsnull) , mOriginalBounds(nsnull)
@ -795,7 +796,7 @@ nsBaseWidget::GetShouldAccelerate()
// we should use AddBoolPrefVarCache // we should use AddBoolPrefVarCache
bool disableAcceleration = bool disableAcceleration =
Preferences::GetBool("layers.acceleration.disabled", false); Preferences::GetBool("layers.acceleration.disabled", false);
bool forceAcceleration = mForceLayersAcceleration =
Preferences::GetBool("layers.acceleration.force-enabled", false); Preferences::GetBool("layers.acceleration.force-enabled", false);
const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED"); const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
@ -828,7 +829,7 @@ nsBaseWidget::GetShouldAccelerate()
if (disableAcceleration || safeMode) if (disableAcceleration || safeMode)
return false; return false;
if (forceAcceleration) if (mForceLayersAcceleration)
return true; return true;
if (!whitelisted) { if (!whitelisted) {
@ -906,7 +907,8 @@ LayerManager* nsBaseWidget::GetLayerManager(PLayersChild* aShadowManager,
* platforms on LayerManagerOGL should ensure their widget is able to * platforms on LayerManagerOGL should ensure their widget is able to
* deal with it though! * deal with it though!
*/ */
if (layerManager->Initialize()) {
if (layerManager->Initialize(mForceLayersAcceleration)) {
mLayerManager = layerManager; mLayerManager = layerManager;
} }
} }

Просмотреть файл

@ -298,6 +298,7 @@ protected:
nsBorderStyle mBorderStyle; nsBorderStyle mBorderStyle;
bool mOnDestroyCalled; bool mOnDestroyCalled;
bool mUseAcceleratedRendering; bool mUseAcceleratedRendering;
bool mForceLayersAcceleration;
bool mTemporarilyUseBasicLayerManager; bool mTemporarilyUseBasicLayerManager;
nsIntRect mBounds; nsIntRect mBounds;
nsIntRect* mOriginalBounds; nsIntRect* mOriginalBounds;