Bug 1246443 - Only restrict displayport base to root composition bounds if content has displayport; r=tnikkel

Bug 1241917 made it so that a subframe's displayport base is restricted
to the root composition bounds (in addition to its previous
restrictions). This involved an expensive coordinate transformation
causing a scrolling performance regression.

This avoids restricting the displayport base to the root composition
bounds unless the frame has a display port, avoiding the expensive
computation unless necessary.

MozReview-Commit-ID: FVacUscAfu2

--HG--
extra : transplant_source : %F9%E9%19%06/%9C%EA%8C%D1%D5%BD%ED%26C%97y%15%92%7E%CB
This commit is contained in:
Jamie Nicol 2016-02-09 13:53:27 +00:00
Родитель 4179c35c7c
Коммит 7a3d99d8ca
1 изменённых файлов: 19 добавлений и 15 удалений

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

@ -3370,6 +3370,9 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
// scrollport.
displayportBase = aDirtyRect->Intersect(mScrollPort);
// Only restrict to the root composition bounds if necessary,
// as the required coordinate transformation is expensive.
if (wasUsingDisplayPort) {
const nsPresContext* rootPresContext =
pc->GetToplevelContentDocumentPresContext();
if (!rootPresContext) {
@ -3390,6 +3393,7 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
displayportBase = displayportBase.Intersect(rootCompBounds);
}
}
}
displayportBase -= mScrollPort.TopLeft();
}