Bug 1573268 - Convert layout.animated-image-layers.enabled to static pref. r=njn

Converts layout.animated-image-layers.enabled to a static pref and removes the nsLayoutUtils::AnimatedImageLayersEnabled() function, replacing it with the static pref.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
kriswright 2019-08-13 00:03:38 +00:00
Родитель 8c68307d03
Коммит 6c57b2f2a8
6 изменённых файлов: 9 добавлений и 23 удалений

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

@ -557,19 +557,6 @@ bool nsLayoutUtils::GPUImageScalingEnabled() {
return sGPUImageScalingEnabled;
}
bool nsLayoutUtils::AnimatedImageLayersEnabled() {
static bool sAnimatedImageLayersEnabled;
static bool sAnimatedImageLayersPrefCached = false;
if (!sAnimatedImageLayersPrefCached) {
sAnimatedImageLayersPrefCached = true;
Preferences::AddBoolVarCache(&sAnimatedImageLayersEnabled,
"layout.animated-image-layers.enabled", false);
}
return sAnimatedImageLayersEnabled;
}
bool nsLayoutUtils::IsInterCharacterRubyEnabled() {
static bool sInterCharacterRubyEnabled;
static bool sInterCharacterRubyEnabledPrefCached = false;

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

@ -2397,11 +2397,6 @@ class nsLayoutUtils {
*/
static bool GPUImageScalingEnabled();
/**
* Checks whether we want to layerize animated images whenever possible.
*/
static bool AnimatedImageLayersEnabled();
/**
* Checks whether support for inter-character ruby is enabled.
*/

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

@ -29,6 +29,7 @@
#include "mozilla/MouseEvents.h"
#include "mozilla/PresShell.h"
#include "mozilla/PresShellInlines.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/Unused.h"
#include "nsCOMPtr.h"
@ -1777,7 +1778,7 @@ LayerState nsDisplayImage::GetLayerState(
const ContainerLayerParameters& aParameters) {
if (!nsDisplayItem::ForceActiveLayers()) {
bool animated = false;
if (!nsLayoutUtils::AnimatedImageLayersEnabled() ||
if (!StaticPrefs::layout_animated_image_layers_enabled() ||
mImage->GetType() != imgIContainer::TYPE_RASTER ||
NS_FAILED(mImage->GetAnimated(&animated)) || !animated) {
if (!aManager->IsCompositingCheap() ||

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

@ -4456,7 +4456,7 @@ nsDisplayBackgroundImage::ShouldCreateOwnLayer(nsDisplayListBuilder* aBuilder,
return WHENEVER_POSSIBLE;
}
if (nsLayoutUtils::AnimatedImageLayersEnabled() && mBackgroundStyle) {
if (StaticPrefs::layout_animated_image_layers_enabled() && mBackgroundStyle) {
const nsStyleImageLayers::Layer& layer =
mBackgroundStyle->StyleBackground()->mImage.mLayers[mLayer];
const nsStyleImage* image = &layer.mImage;

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

@ -4027,6 +4027,12 @@
value: false
mirror: always
# Whether we should layerize all animated images (if otherwise possible).
- name: layout.animated-image-layers.enabled
type: bool
value: false
mirror: always
- name: layout.animation.prerender.partial
type: RelaxedAtomicBool
value: false

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

@ -4950,9 +4950,6 @@ pref("full-screen-api.warning.delay", 500);
// time for the warning box stays on the screen before sliding out, unit: ms
pref("pointer-lock-api.warning.timeout", 3000);
// Whether we should layerize all animated images (if otherwise possible).
pref("layout.animated-image-layers.enabled", false);
pref("dom.vibrator.enabled", true);
pref("dom.vibrator.max_vibrate_ms", 10000);
pref("dom.vibrator.max_vibrate_list_len", 128);