Bug 1247049 - Optimize GetScreenXY by using the new nsDeviceContext method to get desktop scale factor. r=emk

This commit is contained in:
Jonathan Kew 2016-02-15 09:07:53 +00:00
parent c82081b194
commit 99b34eaefa

View File

@ -5065,9 +5065,7 @@ nsGlobalWindow::GetScreenXY(ErrorResult& aError)
LayoutDeviceRect screenRectDev = LayoutDeviceRect screenRectDev =
LayoutDevicePixel::FromAppUnits(screenRect, dc->AppUnitsPerDevPixel()); LayoutDevicePixel::FromAppUnits(screenRect, dc->AppUnitsPerDevPixel());
nsCOMPtr<nsIWidget> widget = GetMainWidget(); DesktopToLayoutDeviceScale scale = dc->GetDesktopToDeviceScale();
DesktopToLayoutDeviceScale scale = widget ? widget->GetDesktopToDeviceScale()
: DesktopToLayoutDeviceScale(1.0);
DesktopRect screenRectDesk = screenRectDev / scale; DesktopRect screenRectDesk = screenRectDev / scale;
CSSPoint cssPt = CSSPoint cssPt =