Bug 1435650 - Cache the offset from AGR to reference frame in ProcessDisplayItems. r=jnicol

This commit is contained in:
Matt Woodrow 2018-02-12 19:03:09 +13:00
parent cf9c739dc2
commit b32db1556e

View File

@ -4041,6 +4041,8 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
bool hadCompositorHitTestInfo = false;
#endif
AnimatedGeometryRoot* lastAnimatedGeometryRoot = nullptr;
nsPoint lastTopLeft;
FlattenedDisplayItemIterator iter(mBuilder, aList);
while (nsDisplayItem* i = iter.GetNext()) {
nsDisplayItem* item = i;
@ -4145,7 +4147,12 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
itemASR = mContainerASR;
item->FuseClipChainUpTo(mBuilder, mContainerASR);
}
topLeft = (*animatedGeometryRoot)->GetOffsetToCrossDoc(mContainerReferenceFrame);
if (animatedGeometryRoot == lastAnimatedGeometryRoot) {
topLeft = lastTopLeft;
} else {
lastTopLeft = topLeft = (*animatedGeometryRoot)->GetOffsetToCrossDoc(mContainerReferenceFrame);
lastAnimatedGeometryRoot = animatedGeometryRoot;
}
const ActiveScrolledRoot* scrollMetadataASR =
layerClipChain ? ActiveScrolledRoot::PickDescendant(itemASR, layerClipChain->mASR) : itemASR;