Bug 1318156 - Add an option to minimize empty area in PaintedLayers. r=mstange

This commit is contained in:
Matt Woodrow 2016-11-24 18:11:30 +13:00
Родитель f23176620b
Коммит d77b5a17ca
2 изменённых файлов: 10 добавлений и 0 удалений

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

@ -538,6 +538,7 @@ private:
// This and code dependent on it should be removed once containerless scrolling looks stable.
DECL_GFX_PREF(Once, "layout.scroll.root-frame-containers", LayoutUseContainersForRootFrames, bool, true);
DECL_GFX_PREF(Live, "layout.smaller-painted-layers", LayoutSmallerPaintedLayers, bool, false);
DECL_GFX_PREF(Once, "media.hardware-video-decoding.force-enabled",
HardwareVideoDecodingForceEnabled, bool, false);

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

@ -2779,8 +2779,17 @@ PaintedLayerDataNode::FindPaintedLayerFor(const nsIntRect& aVisibleRect,
data.mScaledMaybeHitRegionBounds.Intersects(aVisibleRect))) {
break;
}
// If the visible region intersects with the current layer then we
// can't possibly use any of the layers below it, so stop the search
// now.
//
// If we're trying to minimize painted layer size and we don't
// intersect the current visible region, then make sure we don't
// use this painted layer.
if (visibleRegion.Intersects(aVisibleRect)) {
break;
} else if (gfxPrefs::LayoutSmallerPaintedLayers()) {
lowestUsableLayer = nullptr;
}
}
if (lowestUsableLayer) {