Bug 1431778 - Take 3D transforms in to account when deciding whether content is small enough to be prerendered. r=mattwoodrow

MozReview-Commit-ID: 1eV04BMYy97

--HG--
extra : rebase_source : 32889c0455e5e038d2235594240356b0b54792e4
This commit is contained in:
Jamie Nicol 2018-04-06 18:34:13 +01:00
Родитель d226fcc86a
Коммит 24b4e59335
1 изменённых файлов: 8 добавлений и 3 удалений

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

@ -8364,9 +8364,14 @@ nsDisplayTransform::ShouldPrerenderTransformedContent(nsDisplayListBuilder* aBui
nsSize absoluteLimit(aFrame->PresContext()->DevPixelsToAppUnits(absoluteLimitX), nsSize absoluteLimit(aFrame->PresContext()->DevPixelsToAppUnits(absoluteLimitX),
aFrame->PresContext()->DevPixelsToAppUnits(absoluteLimitY)); aFrame->PresContext()->DevPixelsToAppUnits(absoluteLimitY));
nsSize maxSize = Min(relativeLimit, absoluteLimit); nsSize maxSize = Min(relativeLimit, absoluteLimit);
gfxSize scale = nsLayoutUtils::GetTransformToAncestorScale(aFrame);
nsSize frameSize(overflow.Size().width * scale.width, const auto transform = nsLayoutUtils::GetTransformToAncestor(aFrame,
overflow.Size().height * scale.height); nsLayoutUtils::GetDisplayRootFrame(aFrame));
const gfxRect transformedBounds = transform.TransformAndClipBounds(
gfxRect(overflow.x, overflow.y, overflow.width, overflow.height),
gfxRect::MaxIntRect());
const nsSize frameSize = nsSize(transformedBounds.width, transformedBounds.height);
uint64_t maxLimitArea = uint64_t(maxSize.width) * maxSize.height; uint64_t maxLimitArea = uint64_t(maxSize.width) * maxSize.height;
uint64_t frameArea = uint64_t(frameSize.width) * frameSize.height; uint64_t frameArea = uint64_t(frameSize.width) * frameSize.height;
if (frameArea <= maxLimitArea && frameSize <= absoluteLimit) { if (frameArea <= maxLimitArea && frameSize <= absoluteLimit) {