Bug 1720152 - Recurse into replay for dependencies, rather than using a temp surface. r=jrmuizel,bobowen,emilio

Differential Revision: https://phabricator.services.mozilla.com/D120050
This commit is contained in:
Matt Woodrow
2021-08-09 22:07:36 +00:00
parent 74169df6f8
commit 93fd0e91fb
18 changed files with 135 additions and 117 deletions

View File

@@ -1372,9 +1372,19 @@ void nsDisplayRemote::Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) {
return;
}
// Rendering the inner document will apply a scale to account for its
// app units per dev pixel ratio. We want to apply the inverse scaling
// using our app units per dev pixel ratio, so that no actual scaling
// will be applied if they match. For in-process rendering,
// nsSubDocumentFrame creates an nsDisplayZoom item if the app units
// per dev pixel ratio changes.
int32_t appUnitsPerDevPixel = pc->AppUnitsPerDevPixel();
gfxFloat scale = gfxFloat(AppUnitsPerCSSPixel()) / appUnitsPerDevPixel;
gfxContextMatrixAutoSaveRestore saveMatrix(aCtx);
aCtx->Multiply(gfxMatrix::Scaling(scale, scale));
Rect destRect =
NSRectToSnappedRect(GetContentRect(), appUnitsPerDevPixel, *target);
NSRectToSnappedRect(GetContentRect(), AppUnitsPerCSSPixel(), *target);
target->DrawDependentSurface(mPaintData.mTabId, destRect);
}