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
This commit is contained in:
kriswright
2019-08-13 00:03:38 +00:00
parent 9e421576f5
commit b2abfbf59c
6 changed files with 9 additions and 23 deletions

View File

@@ -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() ||