From 0c95eabb497b4206b15c5929cfede246b5d7d1ae Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Fri, 26 Jul 2013 13:20:23 -0700 Subject: [PATCH] Backout 4c89002460da (Bug 873378) for breaking the settings app on B2G --- layout/base/FrameLayerBuilder.cpp | 9 --------- layout/base/nsDisplayList.cpp | 14 -------------- layout/base/nsDisplayList.h | 6 ------ mobile/android/app/mobile.js | 6 ------ modules/libpref/src/init/all.js | 4 ---- 5 files changed, 39 deletions(-) diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 8e22a1d02db5..6dac6c349386 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -2041,9 +2041,6 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList, topLeft = lastActiveScrolledRoot->GetOffsetToCrossDoc(mContainerReferenceFrame); } - int32_t maxLayers = nsDisplayItem::MaxActiveLayers(); - int layerCount = 0; - for (nsDisplayItem* item = aList.GetBottom(); item; item = item->GetAbove()) { NS_ASSERTION(mAppUnitsPerDevPixel == AppUnitsPerDevPixel(item), "items in a container layer should all have the same app units per dev pixel"); @@ -2086,10 +2083,6 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList, } } - if (maxLayers != -1 && layerCount >= maxLayers) { - forceInactive = true; - } - // Assign the item to a layer if (layerState == LAYER_ACTIVE_FORCE || (layerState == LAYER_INACTIVE && !mManager->IsWidgetLayerManager()) || @@ -2097,8 +2090,6 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList, (layerState == LAYER_ACTIVE_EMPTY || layerState == LAYER_ACTIVE))) { - layerCount++; - // LAYER_ACTIVE_EMPTY means the layer is created just for its metadata. // We should never see an empty layer with any visible content! NS_ASSERTION(layerState != LAYER_ACTIVE_EMPTY || diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 0f1fb69392f8..8c7481f153bf 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1497,20 +1497,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 sMaxLayersCached; -} - bool nsDisplayItem::RecomputeVisibility(nsDisplayListBuilder* aBuilder, nsRegion* aVisibleRegion) { diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index d254564a72d5..7f6f5c9248a9 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -1003,12 +1003,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 diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index ba8b4b5ba4ec..1b05ce8563a9 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -546,12 +546,6 @@ pref("layers.async-video.enabled", true); pref("layers.progressive-paint", true); pref("layers.low-precision-buffer", true); pref("layers.low-precision-resolution", 250); -// We want to limit layers for two reasons: -// 1) We can't scroll smoothly if we have to many draw calls -// 2) Pages that have too many layers consume too much memory and crash. -// By limiting the number of layers on mobile we're making the main thread -// work harder keep scrolling smooth and memory low. -pref("layers.max-active", 20); pref("notification.feature.enabled", true); pref("dom.webnotifications.enabled", true); diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 174968a04fb1..118278ea2e29 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -4062,10 +4062,6 @@ pref("layers.acceleration.draw-fps", false); pref("layers.draw-borders", false); pref("layers.frame-counter", false); -// Max number of layers per container. See Overwrite in mobile prefs. -pref("layers.max-active", -1); - - #ifdef XP_MACOSX pref("layers.offmainthreadcomposition.enabled", true); #else