Bug 1235437: Add annotation for major graphics preferences. r?bgirard
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -11,16 +11,17 @@
#include "mozilla/layers/ISurfaceAllocator.h" // for GfxMemoryImageReporter
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Logging.h"
#include "mozilla/Services.h"
#include "prprf.h"
+#include "gfxCrashReporterUtils.h"
#include "gfxPlatform.h"
#include "gfxPrefs.h"
#include "gfxEnv.h"
#include "gfxTextRun.h"
#ifdef XP_WIN
#include <process.h>
#define getpid _getpid
@@ -510,16 +511,54 @@ gfxPlatform::Init()
gEverInitialized = true;
// Initialize the preferences by creating the singleton.
gfxPrefs::GetSingleton();
auto fwd = new CrashStatsLogForwarder("GraphicsCriticalError");
fwd->SetCircularBufferSize(gfxPrefs::GfxLoggingCrashLength());
+ // Drop a note in the crash report if we end up forcing an option that could
+ // destabilize things. New items should be appended at the end (of an existing
+ // or in a new section), so that we don't have to know the version to interpret
+ // these cryptic strings.
+ {
+ nsAutoCString forcedPrefs;
+ // D2D prefs
+ forcedPrefs.AppendPrintf("FP(D%d%d%d",
+ gfxPrefs::Direct2DDisabled(),
+ gfxPrefs::Direct2DForceEnabled(),
+ gfxPrefs::DirectWriteFontRenderingForceEnabled());
+ // Layers prefs
+ forcedPrefs.AppendPrintf("-L%d%d%d%d%d%d",
+ gfxPrefs::LayersAMDSwitchableGfxEnabled(),
+ gfxPrefs::LayersAccelerationDisabled(),
+ gfxPrefs::LayersAccelerationForceEnabled(),
+ gfxPrefs::LayersD3D11DisableWARP(),
+ gfxPrefs::LayersD3D11ForceWARP(),
+ gfxPrefs::LayersOffMainThreadCompositionForceEnabled());
+ // WebGL prefs
+ forcedPrefs.AppendPrintf("-W%d%d%d%d%d%d%d%d",
+ gfxPrefs::WebGLANGLEForceD3D11(),
+ gfxPrefs::WebGLANGLEForceWARP(),
+ gfxPrefs::WebGLDisabled(),
+ gfxPrefs::WebGLDisableANGLE(),
+ gfxPrefs::WebGLDXGLEnabled(),
+ gfxPrefs::WebGLForceEnabled(),
+ gfxPrefs::WebGLForceLayersReadback(),
+ gfxPrefs::WebGLForceMSAA());
+ // Prefs that don't fit into any of the other sections
+ forcedPrefs.AppendPrintf("-T%d%d%d%d) ",
+ gfxPrefs::AndroidRGB16Force(),
+ gfxPrefs::CanvasAzureAccelerated(),
+ gfxPrefs::DisableGralloc(),
+ gfxPrefs::ForceShmemTiles());
+ ScopedGfxFeatureReporter::AppNote(forcedPrefs);
+ }
+
mozilla::gfx::Config cfg;
cfg.mLogForwarder = fwd;
cfg.mMaxTextureSize = gfxPrefs::MaxTextureSize();
cfg.mMaxAllocSize = gfxPrefs::MaxAllocSize();
gfx::Factory::Init(cfg);
gGfxPlatformPrefsLock = new Mutex("gfxPlatform::gGfxPlatformPrefsLock");