mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
[Bug 875204] Merge OMTA prefs r=nrc
This commit is contained in:
parent
631b94994d
commit
c2366b46a1
@ -237,15 +237,13 @@ pref("ui.dragThresholdY", 25);
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
pref("dom.ipc.tabs.disabled", true);
|
||||
pref("layers.offmainthreadcomposition.enabled", false);
|
||||
pref("layers.offmainthreadcomposition.animate-opacity", false);
|
||||
pref("layers.offmainthreadcomposition.animate-transform", false);
|
||||
pref("layers.offmainthreadcomposition.async-animations", false);
|
||||
pref("layers.async-video.enabled", false);
|
||||
#else
|
||||
pref("dom.ipc.tabs.disabled", false);
|
||||
pref("layers.offmainthreadcomposition.enabled", true);
|
||||
pref("layers.acceleration.disabled", false);
|
||||
pref("layers.offmainthreadcomposition.animate-opacity", true);
|
||||
pref("layers.offmainthreadcomposition.animate-transform", true);
|
||||
pref("layers.offmainthreadcomposition.async-animations", true);
|
||||
pref("layers.async-video.enabled", true);
|
||||
pref("layers.async-pan-zoom.enabled", true);
|
||||
#endif
|
||||
|
@ -321,42 +321,20 @@ nsLayoutUtils::Are3DTransformsEnabled()
|
||||
return s3DTransformsEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::AreOpacityAnimationsEnabled()
|
||||
{
|
||||
static bool sAreOpacityAnimationsEnabled;
|
||||
static bool sOpacityPrefCached = false;
|
||||
|
||||
if (!sOpacityPrefCached) {
|
||||
sOpacityPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sAreOpacityAnimationsEnabled,
|
||||
"layers.offmainthreadcomposition.animate-opacity");
|
||||
}
|
||||
|
||||
return sAreOpacityAnimationsEnabled &&
|
||||
gfxPlatform::OffMainThreadCompositingEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::AreTransformAnimationsEnabled()
|
||||
{
|
||||
static bool sAreTransformAnimationsEnabled;
|
||||
static bool sTransformPrefCached = false;
|
||||
|
||||
if (!sTransformPrefCached) {
|
||||
sTransformPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sAreTransformAnimationsEnabled,
|
||||
"layers.offmainthreadcomposition.animate-transform");
|
||||
}
|
||||
|
||||
return sAreTransformAnimationsEnabled &&
|
||||
gfxPlatform::OffMainThreadCompositingEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::AreAsyncAnimationsEnabled()
|
||||
{
|
||||
return AreOpacityAnimationsEnabled() || AreTransformAnimationsEnabled();
|
||||
static bool sAreAsyncAnimationsEnabled;
|
||||
static bool sAsyncPrefCached = false;
|
||||
|
||||
if (!sAsyncPrefCached) {
|
||||
sAsyncPrefCached = true;
|
||||
Preferences::AddBoolVarCache(&sAreAsyncAnimationsEnabled,
|
||||
"layers.offmainthreadcomposition.async-animations");
|
||||
}
|
||||
|
||||
return sAreAsyncAnimationsEnabled &&
|
||||
gfxPlatform::OffMainThreadCompositingEnabled();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1586,10 +1586,8 @@ public:
|
||||
static bool Are3DTransformsEnabled();
|
||||
|
||||
/**
|
||||
* Checks if off-main-thread transform and opacity animations are enabled.
|
||||
* Checks if off-main-thread animations are enabled.
|
||||
*/
|
||||
static bool AreOpacityAnimationsEnabled();
|
||||
static bool AreTransformAnimationsEnabled();
|
||||
static bool AreAsyncAnimationsEnabled();
|
||||
|
||||
/**
|
||||
|
@ -271,15 +271,6 @@ CommonElementAnimationData::CanAnimatePropertyOnCompositor(const dom::Element *a
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (aProperty == eCSSProperty_opacity) {
|
||||
bool enabled = nsLayoutUtils::AreOpacityAnimationsEnabled();
|
||||
if (!enabled && shouldLog) {
|
||||
nsCString message;
|
||||
message.AppendLiteral("Performance warning: Async animation of 'opacity' is disabled");
|
||||
LogAsyncAnimationFailure(message);
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
if (aProperty == eCSSProperty_transform) {
|
||||
if (frame->Preserves3D() &&
|
||||
frame->Preserves3DChildren()) {
|
||||
@ -306,15 +297,14 @@ CommonElementAnimationData::CanAnimatePropertyOnCompositor(const dom::Element *a
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool enabled = nsLayoutUtils::AreTransformAnimationsEnabled();
|
||||
if (!enabled && shouldLog) {
|
||||
nsCString message;
|
||||
message.AppendLiteral("Performance warning: Async animation of 'transform' is disabled");
|
||||
LogAsyncAnimationFailure(message);
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
return aFlags & CanAnimate_AllowPartial;
|
||||
bool enabled = nsLayoutUtils::AreAsyncAnimationsEnabled();
|
||||
if (!enabled && shouldLog) {
|
||||
nsCString message;
|
||||
message.AppendLiteral("Performance warning: Async animations are disabled");
|
||||
LogAsyncAnimationFailure(message);
|
||||
}
|
||||
return enabled && (aFlags & CanAnimate_AllowPartial);
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
|
@ -3989,9 +3989,7 @@ pref("layers.offmainthreadcomposition.enabled", false);
|
||||
// use with tests.
|
||||
pref("layers.offmainthreadcomposition.testing.enabled", false);
|
||||
// Whether to animate simple opacity and transforms on the compositor
|
||||
pref("layers.offmainthreadcomposition.animate-opacity", false);
|
||||
pref("layers.offmainthreadcomposition.animate-transform", false);
|
||||
pref("layers.offmainthreadcomposition.log-animations", false);
|
||||
pref("layers.offmainthreadcomposition.async-animations", false);
|
||||
|
||||
#ifdef MOZ_X11
|
||||
#ifdef MOZ_WIDGET_GTK2
|
||||
|
Loading…
Reference in New Issue
Block a user