Bug 1766078 - Add a ViewAs overload for casting an untyped ScaleFactors2D to a typed one. r=botond

Please note that ScaleFactors2D is missing operator*=() for now,
hence the "resolutionToScreen = resolutionToScreen * X" formula.

Differential Revision: https://phabricator.services.mozilla.com/D144883
This commit is contained in:
Razvan Cojocaru
2022-04-30 00:24:46 +00:00
parent 842c46649d
commit 4bca3d9a59
3 changed files with 11 additions and 7 deletions

View File

@@ -1086,10 +1086,9 @@ void nsImageFrame::MaybeDecodeForPredictedSize() {
// If we are in a remote browser, then apply scaling from ancestor browsers
if (BrowserChild* browserChild = BrowserChild::GetFrom(presShell)) {
resolutionToScreen.xScale *=
browserChild->GetEffectsInfo().mRasterScale.xScale;
resolutionToScreen.yScale *=
browserChild->GetEffectsInfo().mRasterScale.yScale;
resolutionToScreen =
resolutionToScreen * ViewAs<ScreenToScreenScale2D>(
browserChild->GetEffectsInfo().mRasterScale);
}
// ...and this frame's content box...