Bug 1567329 - Change `_do_not_use_directly` suffixes to `_DoNotUseDirectly`. r=erahm

This better distinguishes it from the pref name part of the getter, which uses
snake case.

Differential Revision: https://phabricator.services.mozilla.com/D38603

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicholas Nethercote 2019-07-22 02:09:55 +00:00
Родитель 7a3878cec2
Коммит 77d69c5853
6 изменённых файлов: 22 добавлений и 23 удалений

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

@ -144,7 +144,7 @@ bool LayerManager::LayersComponentAlphaEnabled() {
#ifdef MOZ_GFX_OPTIMIZE_MOBILE
return false;
#else
return StaticPrefs::layers_componentalpha_enabled_do_not_use_directly();
return StaticPrefs::layers_componentalpha_enabled_DoNotUseDirectly();
#endif
}

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

@ -918,8 +918,8 @@ void gfxPlatform::Init() {
// Layers prefs
forcedPrefs.AppendPrintf(
"-L%d%d%d%d", StaticPrefs::layers_amd_switchable_gfx_enabled(),
StaticPrefs::layers_acceleration_disabled_do_not_use_directly(),
StaticPrefs::layers_acceleration_force_enabled_do_not_use_directly(),
StaticPrefs::layers_acceleration_disabled_DoNotUseDirectly(),
StaticPrefs::layers_acceleration_force_enabled_DoNotUseDirectly(),
StaticPrefs::layers_d3d11_force_warp());
// WebGL prefs
forcedPrefs.AppendPrintf(
@ -1138,7 +1138,7 @@ int32_t gfxPlatform::MaxTextureSize() {
// pref or whatnot.
const int32_t kMinSizePref = 2048;
return std::max(kMinSizePref,
StaticPrefs::gfx_max_texture_size_do_not_use_directly());
StaticPrefs::gfx_max_texture_size_DoNotUseDirectly());
}
/* static */
@ -1147,7 +1147,7 @@ int32_t gfxPlatform::MaxAllocSize() {
// pref or whatnot.
const int32_t kMinAllocPref = 10000000;
return std::max(kMinAllocPref,
StaticPrefs::gfx_max_alloc_size_do_not_use_directly());
StaticPrefs::gfx_max_alloc_size_DoNotUseDirectly());
}
/* static */
@ -2505,7 +2505,7 @@ void gfxPlatform::InitCompositorAccelerationPrefs() {
// Base value - does the platform allow acceleration?
if (feature.SetDefault(AccelerateLayersByDefault(), FeatureStatus::Blocked,
"Acceleration blocked by platform")) {
if (StaticPrefs::layers_acceleration_disabled_do_not_use_directly()) {
if (StaticPrefs::layers_acceleration_disabled_DoNotUseDirectly()) {
feature.UserDisable("Disabled by pref",
NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_PREF"));
} else if (acceleratedEnv && *acceleratedEnv == '0') {
@ -2519,7 +2519,7 @@ void gfxPlatform::InitCompositorAccelerationPrefs() {
}
// This has specific meaning elsewhere, so we always record it.
if (StaticPrefs::layers_acceleration_force_enabled_do_not_use_directly()) {
if (StaticPrefs::layers_acceleration_force_enabled_DoNotUseDirectly()) {
feature.UserForceEnable("Force-enabled by pref");
}
@ -2544,7 +2544,7 @@ void gfxPlatform::InitCompositorAccelerationPrefs() {
/*static*/
bool gfxPlatform::WebRenderPrefEnabled() {
return StaticPrefs::gfx_webrender_all() ||
StaticPrefs::gfx_webrender_enabled_do_not_use_directly();
StaticPrefs::gfx_webrender_enabled_DoNotUseDirectly();
}
/*static*/
@ -3196,8 +3196,7 @@ bool gfxPlatform::UsesOffMainThreadCompositing() {
!StaticPrefs::layers_offmainthreadcomposition_force_disabled();
#if defined(MOZ_WIDGET_GTK)
// Linux users who chose OpenGL are being grandfathered in to OMTC
result |=
StaticPrefs::layers_acceleration_force_enabled_do_not_use_directly();
result |= StaticPrefs::layers_acceleration_force_enabled_DoNotUseDirectly();
#endif
firstTime = false;
@ -3474,7 +3473,7 @@ bool gfxPlatform::AsyncPanZoomEnabled() {
#ifdef MOZ_WIDGET_ANDROID
return true;
#else
return StaticPrefs::layers_async_pan_zoom_enabled_do_not_use_directly();
return StaticPrefs::layers_async_pan_zoom_enabled_DoNotUseDirectly();
#endif
}
@ -3636,7 +3635,7 @@ void gfxPlatform::InitOpenGLConfig() {
// When layers acceleration is force-enabled, enable it even for blacklisted
// devices.
if (StaticPrefs::layers_acceleration_force_enabled_do_not_use_directly()) {
if (StaticPrefs::layers_acceleration_force_enabled_DoNotUseDirectly()) {
openGLFeature.UserForceEnable("Force-enabled by pref");
return;
}

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

@ -1384,9 +1384,9 @@ void gfxWindowsPlatform::InitializeAdvancedLayersConfig() {
FeatureState& al = gfxConfig::GetFeature(Feature::ADVANCED_LAYERS);
al.SetDefaultFromPref(
StaticPrefs::GetPrefName_layers_mlgpu_enabled_do_not_use_directly(),
StaticPrefs::GetPrefName_layers_mlgpu_enabled_DoNotUseDirectly(),
true /* aIsEnablePref */,
StaticPrefs::GetPrefDefault_layers_mlgpu_enabled_do_not_use_directly());
StaticPrefs::GetPrefDefault_layers_mlgpu_enabled_DoNotUseDirectly());
// Windows 7 has an extra pref since it uses totally different buffer paths
// that haven't been performance tested yet.

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

@ -84,12 +84,12 @@
# Note that Rust code must access the global variable directly, rather than
# via the getter.
#
# - `do_not_use_directly` dictates if `_do_not_use_directly` should be
# appended to the name of the getter function. This is simply a naming
# convention indicating that there is some other wrapper getter function
# that should be used in preference to the normal static pref getter.
# Defaults to `false` if not present. Cannot be used with a `never` mirror
# value, because there is no getter function in that case.
# - `do_not_use_directly` dictates if `_DoNotUseDirectly` should be appended to
# the name of the getter function. This is simply a naming convention
# indicating that there is some other wrapper getter function that should be
# used in preference to the normal static pref getter. Defaults to `false` if
# not present. Cannot be used with a `never` mirror value, because there is
# no getter function in that case.
#
# Preprocessor
# ------------

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

@ -88,7 +88,7 @@ def pref_id(pref):
id = pref['name'].replace('.', '_').replace('-', '_')
if pref.get('do_not_use_directly'):
id += '_do_not_use_directly'
id += '_DoNotUseDirectly'
return id

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

@ -106,7 +106,7 @@ VARCACHE_PREF(
VARCACHE_PREF(
Once,
"my.float",
my_float_do_not_use_directly,
my_float_DoNotUseDirectly,
float, 0.0f
)
@ -124,7 +124,7 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"my.atomic.int",
my_atomic_int_do_not_use_directly,
my_atomic_int_DoNotUseDirectly,
ReleaseAcquireAtomicInt32, 10 + 10 * 20
)