mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1369542 - Hook up OMTP to config/about:support/crash annotation system. r=dvander
--HG-- extra : rebase_source : dbf55894b92f7964ab6f64469394117179142f9a
This commit is contained in:
parent
6482da932f
commit
0fe1d756ab
@ -25,6 +25,7 @@ namespace gfx {
|
||||
_(DIRECT_DRAW, Feature, "DirectDraw") \
|
||||
_(GPU_PROCESS, Feature, "GPU Process") \
|
||||
_(WEBRENDER, Feature, "WebRender") \
|
||||
_(OMTP, Feature, "Off Main Thread Painting") \
|
||||
/* Add new entries above this comment */
|
||||
|
||||
enum class Feature : uint32_t {
|
||||
|
@ -38,6 +38,7 @@ class gfxVarReceiver;
|
||||
_(UseWebRenderANGLE, bool, false) \
|
||||
_(ScreenDepth, int32_t, 0) \
|
||||
_(GREDirectory, nsCString, nsCString()) \
|
||||
_(UseOMTP, bool, false) \
|
||||
|
||||
/* Add new entries above this line. */
|
||||
|
||||
|
@ -694,6 +694,7 @@ gfxPlatform::Init()
|
||||
#endif
|
||||
gPlatform->InitAcceleration();
|
||||
gPlatform->InitWebRenderConfig();
|
||||
gPlatform->InitOMTPConfig();
|
||||
|
||||
if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
|
||||
GPUProcessManager* gpu = GPUProcessManager::Get();
|
||||
@ -2397,6 +2398,48 @@ gfxPlatform::InitWebRenderConfig()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gfxPlatform::InitOMTPConfig()
|
||||
{
|
||||
bool prefEnabled = Preferences::GetBool("layers.omtp.enabled", false);
|
||||
|
||||
// We don't want to report anything for this feature when turned off, as it is still early in development
|
||||
if (!prefEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScopedGfxFeatureReporter reporter("OMTP", prefEnabled);
|
||||
|
||||
if (!XRE_IsParentProcess()) {
|
||||
// The parent process runs through all the real decision-making code
|
||||
// later in this function. For other processes we still want to report
|
||||
// the state of the feature for crash reports.
|
||||
if (gfxVars::UseOMTP()) {
|
||||
reporter.SetSuccessful();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
FeatureState& featureOMTP = gfxConfig::GetFeature(Feature::OMTP);
|
||||
|
||||
featureOMTP.DisableByDefault(
|
||||
FeatureStatus::OptIn,
|
||||
"OMTP is an opt-in feature",
|
||||
NS_LITERAL_CSTRING("FEATURE_FAILURE_DEFAULT_OFF"));
|
||||
|
||||
featureOMTP.UserEnable("Enabled by pref");
|
||||
|
||||
if (InSafeMode()) {
|
||||
featureOMTP.ForceDisable(FeatureStatus::Blocked, "OMTP blocked by safe-mode",
|
||||
NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_SAFEMODE"));
|
||||
}
|
||||
|
||||
if (gfxConfig::IsEnabled(Feature::OMTP)) {
|
||||
gfxVars::SetUseOMTP(true);
|
||||
reporter.SetSuccessful();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
gfxPlatform::CanUseHardwareVideoDecoding()
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ public:
|
||||
|
||||
static already_AddRefed<DrawTarget>
|
||||
CreateDrawTargetForData(unsigned char* aData,
|
||||
const mozilla::gfx::IntSize& aSize,
|
||||
const mozilla::gfx::IntSize& aSize,
|
||||
int32_t aStride,
|
||||
mozilla::gfx::SurfaceFormat aFormat,
|
||||
bool aUninitialized = false);
|
||||
@ -376,7 +376,7 @@ public:
|
||||
gfxTextPerfMetrics* aTextPerf,
|
||||
gfxUserFontSet *aUserFontSet,
|
||||
gfxFloat aDevToCssSize) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Look up a local platform font using the full font face name.
|
||||
* (Needed to support @font-face src local().)
|
||||
@ -780,7 +780,7 @@ protected:
|
||||
|
||||
int8_t mBidiNumeralOption;
|
||||
|
||||
// whether to always search font cmaps globally
|
||||
// whether to always search font cmaps globally
|
||||
// when doing system font fallback
|
||||
int8_t mFallbackUsesCmaps;
|
||||
|
||||
@ -827,6 +827,7 @@ private:
|
||||
void InitCompositorAccelerationPrefs();
|
||||
void InitGPUProcessPrefs();
|
||||
void InitWebRenderConfig();
|
||||
void InitOMTPConfig();
|
||||
|
||||
static bool IsDXInterop2Blocked();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user