зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
d53f214bf8
Коммит
ae595ed94c
|
@ -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. */
|
||||
|
|
Загрузка…
Ссылка в новой задаче