mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
Bug 1553018 part 2. Make various gfx preferences bindings use in Pref annotations on interfaces follow the StaticPrefs naming convention for getters. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D32943 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
46934887af
commit
d2959ecb98
@ -31,7 +31,7 @@ UniquePtr<webgl::FormatUsageAuthority> WebGL2Context::CreateFormatUsage(
|
||||
}
|
||||
|
||||
/*static*/
|
||||
bool WebGL2Context::IsSupported() { return StaticPrefs::WebGL2Enabled(); }
|
||||
bool WebGL2Context::IsSupported() { return StaticPrefs::webgl_enable_webgl2(); }
|
||||
|
||||
/*static*/
|
||||
WebGL2Context* WebGL2Context::Create() { return new WebGL2Context(); }
|
||||
|
@ -369,7 +369,7 @@ APZCTreeManager::UpdateHitTestingTreeImpl(LayersId aRootLayerTreeId,
|
||||
// For testing purposes, we log some data to the APZTestData associated with
|
||||
// the layers id that originated this update.
|
||||
APZTestData* testData = nullptr;
|
||||
if (StaticPrefs::APZTestLoggingEnabled()) {
|
||||
if (StaticPrefs::apz_test_logging_enabled()) {
|
||||
MutexAutoLock lock(mTestDataLock);
|
||||
UniquePtr<APZTestData> ptr = MakeUnique<APZTestData>();
|
||||
auto result = mTestData.insert(
|
||||
@ -1306,7 +1306,7 @@ nsEventStatus APZCTreeManager::ReceiveInputEvent(
|
||||
}
|
||||
|
||||
if (apzc) {
|
||||
if (StaticPrefs::APZTestLoggingEnabled() &&
|
||||
if (StaticPrefs::apz_test_logging_enabled() &&
|
||||
mouseInput.mType == MouseInput::MOUSE_HITTEST) {
|
||||
ScrollableLayerGuid guid = apzc->GetGuid();
|
||||
|
||||
|
@ -130,7 +130,7 @@ class APZPaintLogHelper {
|
||||
public:
|
||||
APZPaintLogHelper(APZTestData* aTestData, SequenceNumber aPaintSequenceNumber)
|
||||
: mTestData(aTestData), mPaintSequenceNumber(aPaintSequenceNumber) {
|
||||
MOZ_ASSERT(!aTestData || StaticPrefs::APZTestLoggingEnabled(),
|
||||
MOZ_ASSERT(!aTestData || StaticPrefs::apz_test_logging_enabled(),
|
||||
"don't call me");
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ void APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
|
||||
|
||||
if (sentContentResponse && !isTouchPrevented &&
|
||||
aApzResponse == nsEventStatus_eConsumeDoDefault &&
|
||||
StaticPrefs::PointerEventsEnabled()) {
|
||||
StaticPrefs::dom_w3c_pointer_events_enabled()) {
|
||||
WidgetTouchEvent cancelEvent(aEvent);
|
||||
cancelEvent.mMessage = eTouchPointerCancel;
|
||||
cancelEvent.mFlags.mCancelable = false; // mMessage != eTouchCancel;
|
||||
|
@ -244,7 +244,7 @@ bool ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget,
|
||||
// enabled in this process; it may be enabled in the parent process,
|
||||
// and the parent process expects unique sequence numbers.
|
||||
++mPaintSequenceNumber;
|
||||
if (StaticPrefs::APZTestLoggingEnabled()) {
|
||||
if (StaticPrefs::apz_test_logging_enabled()) {
|
||||
mApzTestData.StartNewPaint(mPaintSequenceNumber);
|
||||
}
|
||||
}
|
||||
@ -545,7 +545,7 @@ float ClientLayerManager::RequestProperty(const nsAString& aProperty) {
|
||||
|
||||
void ClientLayerManager::StartNewRepaintRequest(
|
||||
SequenceNumber aSequenceNumber) {
|
||||
if (StaticPrefs::APZTestLoggingEnabled()) {
|
||||
if (StaticPrefs::apz_test_logging_enabled()) {
|
||||
mApzTestData.StartNewRepaintRequest(aSequenceNumber);
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ class ClientLayerManager final : public LayerManager,
|
||||
void LogTestDataForCurrentPaint(ScrollableLayerGuid::ViewID aScrollId,
|
||||
const std::string& aKey,
|
||||
const std::string& aValue) {
|
||||
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
|
||||
MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me");
|
||||
mApzTestData.LogTestDataForPaint(mPaintSequenceNumber, aScrollId, aKey,
|
||||
aValue);
|
||||
}
|
||||
@ -215,18 +215,18 @@ class ClientLayerManager final : public LayerManager,
|
||||
|
||||
// TODO(botond): When we start using this and write a wrapper similar to
|
||||
// nsLayoutUtils::LogTestDataForPaint(), make sure that wrapper checks
|
||||
// StaticPrefs::APZTestLoggingEnabled().
|
||||
// StaticPrefs::apz_test_logging_enabled().
|
||||
void LogTestDataForRepaintRequest(SequenceNumber aSequenceNumber,
|
||||
ScrollableLayerGuid::ViewID aScrollId,
|
||||
const std::string& aKey,
|
||||
const std::string& aValue) {
|
||||
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
|
||||
MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me");
|
||||
mApzTestData.LogTestDataForRepaintRequest(aSequenceNumber, aScrollId, aKey,
|
||||
aValue);
|
||||
}
|
||||
void LogAdditionalTestData(const std::string& aKey,
|
||||
const std::string& aValue) {
|
||||
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
|
||||
MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me");
|
||||
mApzTestData.RecordAdditionalData(aKey, aValue);
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ bool WebRenderLayerManager::BeginTransaction(const nsCString& aURL) {
|
||||
// enabled in this process; it may be enabled in the parent process,
|
||||
// and the parent process expects unique sequence numbers.
|
||||
++mPaintSequenceNumber;
|
||||
if (StaticPrefs::APZTestLoggingEnabled()) {
|
||||
if (StaticPrefs::apz_test_logging_enabled()) {
|
||||
mApzTestData.StartNewPaint(mPaintSequenceNumber);
|
||||
}
|
||||
return true;
|
||||
|
@ -154,13 +154,13 @@ class WebRenderLayerManager final : public LayerManager {
|
||||
void LogTestDataForCurrentPaint(ScrollableLayerGuid::ViewID aScrollId,
|
||||
const std::string& aKey,
|
||||
const std::string& aValue) {
|
||||
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
|
||||
MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me");
|
||||
mApzTestData.LogTestDataForPaint(mPaintSequenceNumber, aScrollId, aKey,
|
||||
aValue);
|
||||
}
|
||||
void LogAdditionalTestData(const std::string& aKey,
|
||||
const std::string& aValue) {
|
||||
MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
|
||||
MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me");
|
||||
mApzTestData.RecordAdditionalData(aKey, aValue);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ VRManager::VRManager()
|
||||
|
||||
// Enable gamepad extensions while VR is enabled.
|
||||
// Preference only can be set at the Parent process.
|
||||
if (XRE_IsParentProcess() && StaticPrefs::VREnabled()) {
|
||||
if (XRE_IsParentProcess() && StaticPrefs::dom_vr_enabled()) {
|
||||
Preferences::SetBool("dom.gamepad.extensions.enabled", true);
|
||||
}
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ already_AddRefed<VRSystemManagerExternal> VRSystemManagerExternal::Create(
|
||||
VRExternalShmem* aAPIShmem /* = nullptr*/) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!StaticPrefs::VREnabled()) {
|
||||
if (!StaticPrefs::dom_vr_enabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -640,7 +640,7 @@ VRSystemManagerPuppet::VRSystemManagerPuppet()
|
||||
|
||||
/*static*/
|
||||
already_AddRefed<VRSystemManagerPuppet> VRSystemManagerPuppet::Create() {
|
||||
if (!StaticPrefs::VREnabled() || !StaticPrefs::VRPuppetEnabled()) {
|
||||
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VRPuppetEnabled()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ OSVRSession::OSVRSession()
|
||||
OSVRSession::~OSVRSession() { Shutdown(); }
|
||||
|
||||
bool OSVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
|
||||
if (!StaticPrefs::VREnabled() || !StaticPrefs::VROSVREnabled()) {
|
||||
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROSVREnabled()) {
|
||||
return false;
|
||||
}
|
||||
if (mOSVRInitialized) {
|
||||
@ -494,4 +494,4 @@ void OSVRSession::VibrateHaptic(uint32_t aControllerIdx, uint32_t aHapticIndex,
|
||||
|
||||
void OSVRSession::StopVibrateHaptic(uint32_t aControllerIdx) {}
|
||||
|
||||
void OSVRSession::StopAllHaptics() {}
|
||||
void OSVRSession::StopAllHaptics() {}
|
||||
|
@ -206,7 +206,7 @@ OculusSession::OculusSession()
|
||||
OculusSession::~OculusSession() { Shutdown(); }
|
||||
|
||||
bool OculusSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
|
||||
if (!StaticPrefs::VREnabled() || !StaticPrefs::VROculusEnabled()) {
|
||||
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROculusEnabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ OpenVRSession::~OpenVRSession() {
|
||||
}
|
||||
|
||||
bool OpenVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
|
||||
if (!StaticPrefs::VREnabled() || !StaticPrefs::VROpenVREnabled()) {
|
||||
if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROpenVREnabled()) {
|
||||
return false;
|
||||
}
|
||||
if (mVRSystem != nullptr) {
|
||||
|
@ -8602,7 +8602,7 @@ void nsLayoutUtils::LogAdditionalTestData(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
/* static */
|
||||
bool nsLayoutUtils::IsAPZTestLoggingEnabled() {
|
||||
return StaticPrefs::APZTestLoggingEnabled();
|
||||
return StaticPrefs::apz_test_logging_enabled();
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
@ -9140,7 +9140,7 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
|
||||
aScrollFrame ? aScrollFrame : aForFrame, isRootContentDocRootScrollFrame,
|
||||
metrics));
|
||||
|
||||
if (StaticPrefs::APZPrintTree() || StaticPrefs::APZTestLoggingEnabled()) {
|
||||
if (StaticPrefs::APZPrintTree() || StaticPrefs::apz_test_logging_enabled()) {
|
||||
if (nsIContent* content =
|
||||
frameForCompositionBoundsCalculation->GetContent()) {
|
||||
nsAutoString contentDescription;
|
||||
|
@ -1101,7 +1101,7 @@ nsRect nsDisplayListBuilder::OutOfFlowDisplayData::ComputeVisibleRectForFrame(
|
||||
}
|
||||
}
|
||||
visible = dirtyRectRelativeToDirtyFrame;
|
||||
if (StaticPrefs::APZTestLoggingEnabled() &&
|
||||
if (StaticPrefs::apz_test_logging_enabled() &&
|
||||
presShell->GetDocument()->IsContentDocument()) {
|
||||
nsLayoutUtils::LogAdditionalTestData(
|
||||
aBuilder, "fixedPosDisplayport",
|
||||
|
@ -560,7 +560,7 @@ VARCACHE_PREF(
|
||||
VARCACHE_PREF(
|
||||
Live,
|
||||
"apz.test.logging_enabled",
|
||||
APZTestLoggingEnabled,
|
||||
apz_test_logging_enabled,
|
||||
RelaxedAtomicBool, false
|
||||
)
|
||||
|
||||
@ -1690,7 +1690,7 @@ VARCACHE_PREF(
|
||||
VARCACHE_PREF(
|
||||
Once,
|
||||
"dom.vr.enabled",
|
||||
VREnabled,
|
||||
dom_vr_enabled,
|
||||
bool, false
|
||||
)
|
||||
|
||||
@ -1862,12 +1862,19 @@ VARCACHE_PREF(
|
||||
bool, true
|
||||
)
|
||||
|
||||
// W3C draft pointer events
|
||||
#ifdef ANDROID
|
||||
# define PREF_VALUE false
|
||||
#else
|
||||
# define PREF_VALUE true
|
||||
#endif
|
||||
VARCACHE_PREF(
|
||||
Live,
|
||||
"dom.w3c_pointer_events.enabled",
|
||||
PointerEventsEnabled,
|
||||
RelaxedAtomicBool, false
|
||||
dom_w3c_pointer_events_enabled,
|
||||
RelaxedAtomicBool, PREF_VALUE
|
||||
)
|
||||
#undef PREF_VALUE
|
||||
|
||||
// In case Touch API is enabled, this pref controls whether to support
|
||||
// ontouch* event handlers, document.createTouch, document.createTouchList and
|
||||
@ -6167,7 +6174,7 @@ VARCACHE_PREF(
|
||||
VARCACHE_PREF(
|
||||
Live,
|
||||
"webgl.enable-webgl2",
|
||||
WebGL2Enabled,
|
||||
webgl_enable_webgl2,
|
||||
RelaxedAtomicBool, true
|
||||
)
|
||||
|
||||
|
@ -5327,13 +5327,6 @@ pref("dom.w3c_touch_events.enabled", 0);
|
||||
pref("dom.w3c_touch_events.enabled", 2);
|
||||
#endif
|
||||
|
||||
// W3C draft pointer events
|
||||
#if !defined(ANDROID)
|
||||
pref("dom.w3c_pointer_events.enabled", true);
|
||||
#else
|
||||
pref("dom.w3c_pointer_events.enabled", false);
|
||||
#endif
|
||||
|
||||
// Control firing WidgetMouseEvent by handling Windows pointer messages or mouse
|
||||
// messages.
|
||||
#if defined(XP_WIN)
|
||||
|
@ -4195,7 +4195,8 @@ bool nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam,
|
||||
// Messages should be only at topLevel window.
|
||||
&& nsWindowType::eWindowType_toplevel == mWindowType
|
||||
// Currently this scheme is used only when pointer events is enabled.
|
||||
&& StaticPrefs::PointerEventsEnabled() && InkCollector::sInkCollector) {
|
||||
&& StaticPrefs::dom_w3c_pointer_events_enabled() &&
|
||||
InkCollector::sInkCollector) {
|
||||
InkCollector::sInkCollector->SetTarget(mWnd);
|
||||
InkCollector::sInkCollector->SetPointerId(pointerId);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user