Bug 1252929: Next.1. Make layers.max-active preference not need a restart. r=mstange
This commit is contained in:
@@ -364,6 +364,7 @@ private:
|
||||
DECL_GFX_PREF(Live, "layers.low-precision-buffer", UseLowPrecisionBuffer, bool, false);
|
||||
DECL_GFX_PREF(Live, "layers.low-precision-opacity", LowPrecisionOpacity, float, 1.0f);
|
||||
DECL_GFX_PREF(Live, "layers.low-precision-resolution", LowPrecisionResolution, float, 0.25f);
|
||||
DECL_GFX_PREF(Live, "layers.max-active", MaxActiveLayers, int32_t, -1);
|
||||
DECL_GFX_PREF(Once, "layers.offmainthreadcomposition.enabled", LayersOffMainThreadCompositionEnabled, bool, false);
|
||||
DECL_GFX_PREF(Once, "layers.offmainthreadcomposition.force-enabled", LayersOffMainThreadCompositionForceEnabled, bool, false);
|
||||
DECL_GFX_PREF(Live, "layers.offmainthreadcomposition.frame-rate", LayersCompositionFrameRate, int32_t,-1);
|
||||
|
||||
@@ -3739,7 +3739,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
|
||||
}
|
||||
}
|
||||
|
||||
int32_t maxLayers = nsDisplayItem::MaxActiveLayers();
|
||||
int32_t maxLayers = gfxPrefs::MaxActiveLayers();
|
||||
int layerCount = 0;
|
||||
|
||||
nsDisplayList savedItems;
|
||||
|
||||
@@ -2188,20 +2188,6 @@ nsDisplayItem::ForceActiveLayers()
|
||||
return sForce;
|
||||
}
|
||||
|
||||
/* static */ int32_t
|
||||
nsDisplayItem::MaxActiveLayers()
|
||||
{
|
||||
static int32_t sMaxLayers = false;
|
||||
static bool sMaxLayersCached = false;
|
||||
|
||||
if (!sMaxLayersCached) {
|
||||
Preferences::AddIntVarCache(&sMaxLayers, "layers.max-active", -1);
|
||||
sMaxLayersCached = true;
|
||||
}
|
||||
|
||||
return sMaxLayers;
|
||||
}
|
||||
|
||||
static int32_t ZIndexForFrame(nsIFrame* aFrame)
|
||||
{
|
||||
if (!aFrame->IsAbsPosContaininingBlock() && !aFrame->IsFlexOrGridItem())
|
||||
|
||||
@@ -1578,12 +1578,6 @@ public:
|
||||
*/
|
||||
static bool ForceActiveLayers();
|
||||
|
||||
/**
|
||||
* Returns the maximum number of layers that should be created
|
||||
* or -1 for no limit. Requires setting the pref layers.max-acitve.
|
||||
*/
|
||||
static int32_t MaxActiveLayers();
|
||||
|
||||
/**
|
||||
* @return LAYER_NONE if BuildLayer will return null. In this case
|
||||
* there is no layer for the item, and Paint should be called instead
|
||||
|
||||
Reference in New Issue
Block a user