Bug 1252929: Next.1. Make layers.max-active preference not need a restart. r=mstange

This commit is contained in:
Milan Sreckovic
2016-03-04 12:13:57 -05:00
parent 8dbaf55085
commit 9475f9de56
4 changed files with 2 additions and 21 deletions

View File

@@ -364,6 +364,7 @@ private:
DECL_GFX_PREF(Live, "layers.low-precision-buffer", UseLowPrecisionBuffer, bool, false); 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-opacity", LowPrecisionOpacity, float, 1.0f);
DECL_GFX_PREF(Live, "layers.low-precision-resolution", LowPrecisionResolution, float, 0.25f); 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.enabled", LayersOffMainThreadCompositionEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.offmainthreadcomposition.force-enabled", LayersOffMainThreadCompositionForceEnabled, 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); DECL_GFX_PREF(Live, "layers.offmainthreadcomposition.frame-rate", LayersCompositionFrameRate, int32_t,-1);

View File

@@ -3739,7 +3739,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
} }
} }
int32_t maxLayers = nsDisplayItem::MaxActiveLayers(); int32_t maxLayers = gfxPrefs::MaxActiveLayers();
int layerCount = 0; int layerCount = 0;
nsDisplayList savedItems; nsDisplayList savedItems;

View File

@@ -2188,20 +2188,6 @@ nsDisplayItem::ForceActiveLayers()
return sForce; 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) static int32_t ZIndexForFrame(nsIFrame* aFrame)
{ {
if (!aFrame->IsAbsPosContaininingBlock() && !aFrame->IsFlexOrGridItem()) if (!aFrame->IsAbsPosContaininingBlock() && !aFrame->IsFlexOrGridItem())

View File

@@ -1578,12 +1578,6 @@ public:
*/ */
static bool ForceActiveLayers(); 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 * @return LAYER_NONE if BuildLayer will return null. In this case
* there is no layer for the item, and Paint should be called instead * there is no layer for the item, and Paint should be called instead