Bug 972713. Part 2: Ignore active scrolled roots in inactive layer trees, because they don't help and could hurt. r=mattwoodrow

--HG--
extra : rebase_source : 3c1c4abb6685f106f927f0f43dbb62fe64a37038
This commit is contained in:
Robert O'Callahan 2014-02-18 17:00:35 +13:00
parent 9746772c09
commit 30049521fc

View File

@ -2375,18 +2375,16 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
{
PROFILER_LABEL("ContainerState", "ProcessDisplayItems");
const nsIFrame* lastAnimatedGeometryRoot = nullptr;
nsPoint topLeft;
const nsIFrame* lastAnimatedGeometryRoot = mContainerReferenceFrame;
nsPoint topLeft(0,0);
// When NO_COMPONENT_ALPHA is set, items will be flattened into a single
// layer, so we need to choose which active scrolled root to use for all
// items.
if (aFlags & NO_COMPONENT_ALPHA) {
if (!ChooseAnimatedGeometryRoot(aList, &lastAnimatedGeometryRoot)) {
lastAnimatedGeometryRoot = mContainerReferenceFrame;
if (ChooseAnimatedGeometryRoot(aList, &lastAnimatedGeometryRoot)) {
topLeft = lastAnimatedGeometryRoot->GetOffsetToCrossDoc(mContainerReferenceFrame);
}
topLeft = lastAnimatedGeometryRoot->GetOffsetToCrossDoc(mContainerReferenceFrame);
}
int32_t maxLayers = nsDisplayItem::MaxActiveLayers();
@ -2426,7 +2424,14 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
animatedGeometryRoot = lastAnimatedGeometryRoot;
} else {
forceInactive = false;
animatedGeometryRoot = nsLayoutUtils::GetAnimatedGeometryRootFor(item, mBuilder);
if (mManager->IsWidgetLayerManager()) {
animatedGeometryRoot = nsLayoutUtils::GetAnimatedGeometryRootFor(item, mBuilder);
} else {
// For inactive layer subtrees, splitting content into ThebesLayers
// based on animated geometry roots is pointless. It's more efficient
// to build the minimum number of layers.
animatedGeometryRoot = mContainerReferenceFrame;
}
if (animatedGeometryRoot != lastAnimatedGeometryRoot) {
lastAnimatedGeometryRoot = animatedGeometryRoot;
topLeft = animatedGeometryRoot->GetOffsetToCrossDoc(mContainerReferenceFrame);