зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1246346 - patch 1 - Expose a DesktopToDevice scale factor on nsDeviceContext. r=emk
This commit is contained in:
Родитель
85662348a4
Коммит
01c301aa57
|
@ -722,3 +722,18 @@ nsDeviceContext::UpdateAppUnitsForFullZoom()
|
|||
// adjust mFullZoom to reflect appunit rounding
|
||||
mFullZoom = float(mAppUnitsPerDevPixelAtUnitFullZoom) / mAppUnitsPerDevPixel;
|
||||
}
|
||||
|
||||
DesktopToLayoutDeviceScale
|
||||
nsDeviceContext::GetDesktopToDeviceScale()
|
||||
{
|
||||
nsCOMPtr<nsIScreen> screen;
|
||||
FindScreen(getter_AddRefs(screen));
|
||||
|
||||
if (screen) {
|
||||
double scale;
|
||||
screen->GetContentsScaleFactor(&scale);
|
||||
return DesktopToLayoutDeviceScale(scale);
|
||||
}
|
||||
|
||||
return DesktopToLayoutDeviceScale(1.0);
|
||||
}
|
||||
|
|
|
@ -251,6 +251,8 @@ public:
|
|||
*/
|
||||
bool IsPrinterSurface();
|
||||
|
||||
mozilla::DesktopToLayoutDeviceScale GetDesktopToDeviceScale();
|
||||
|
||||
private:
|
||||
// Private destructor, to discourage deletion outside of Release():
|
||||
~nsDeviceContext();
|
||||
|
|
Загрузка…
Ссылка в новой задаче