Bug 724189: Add a little fuzz factor to the max pre-render size for transformed frames, in case the frame has borders or shadows. r=roc

This commit is contained in:
Chris Jones 2012-02-05 08:34:10 -08:00
Родитель d53f214bf8
Коммит ae595ed94c
1 изменённых файлов: 9 добавлений и 3 удалений

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

@ -2574,9 +2574,15 @@ bool
nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame)
{
return aFrame->AreLayersMarkedActive(nsChangeHint_UpdateTransformLayer) &&
aFrame->GetVisualOverflowRectRelativeToSelf().Size() <=
aBuilder->ReferenceFrame()->GetSize();
if (aFrame->AreLayersMarkedActive(nsChangeHint_UpdateTransformLayer)) {
nsSize refSize = aBuilder->ReferenceFrame()->GetSize();
// Only prerender if the transformed frame's size is <= the
// reference frame size (~viewport), allowing a 1/8th fuzz factor
// for shadows, borders, etc.
refSize += nsSize(refSize.width / 8, refSize.height / 8);
return aFrame->GetVisualOverflowRectRelativeToSelf().Size() <= refSize;
}
return false;
}
/* If the matrix is singular, or a hidden backface is shown, the frame won't be visible or hit. */