Bug 1351329 - Fix Windows implementation of defaultCSSScaleFactor. r=kanru

Unlike contentsScaleFactor, defaultCSSScaleFactor always uses WinUtils::LogToPhysFactor regardless of the DPI awareness. Bug 1194751 broke the implementation (probably unknowingly).

MozReview-Commit-ID: KjtnT2ebgHK

--HG--
extra : rebase_source : 6fe3d58293482563cc4fc4f16a91fa4a3c4c12da
This commit is contained in:
Masatoshi Kimura 2017-03-29 01:40:47 +09:00
Родитель 87716f1d4e
Коммит b1aecb3f20
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -27,15 +27,16 @@ CollectMonitors(HMONITOR aMon, HDC, LPRECT, LPARAM ioParam)
MOZ_LOG(sScreenLog, LogLevel::Error, ("GetMonitorInfoW failed"));
return TRUE; // continue the enumeration
}
double scale = WinUtils::LogToPhysFactor(aMon);
DesktopToLayoutDeviceScale contentsScaleFactor;
if (WinUtils::IsPerMonitorDPIAware()) {
contentsScaleFactor.scale = 1.0;
} else {
contentsScaleFactor.scale = WinUtils::LogToPhysFactor(aMon);
contentsScaleFactor.scale = scale;
}
CSSToLayoutDeviceScale defaultCssScaleFactor(nsIWidget::DefaultScaleOverride());
if (defaultCssScaleFactor.scale <= 0.0) {
defaultCssScaleFactor.scale = contentsScaleFactor.scale;
defaultCssScaleFactor.scale = scale;
}
LayoutDeviceIntRect rect(info.rcMonitor.left, info.rcMonitor.top,
info.rcMonitor.right - info.rcMonitor.left,