Bug 888781 part 1 - Use cached default scale in GetDefaultScaleInternal of Windows. r?jimm draft
authorXidorn Quan <me@upsuper.org>
Mon, 19 Sep 2016 10:35:12 +1000
changeset 414765 665ef53dfafe5dfcfeedd2cfd1f069574843d995
parent 414764 1c88ef5d84f1f890ffb2a4150afe1e5e6482a56b
child 414766 21dbf6de359284f7ad0d8b3af0f7c9cdb8d53bd2
push id29752
push userxquan@mozilla.com
push dateMon, 19 Sep 2016 00:36:25 +0000
reviewersjimm
bugs888781
milestone51.0a1
Bug 888781 part 1 - Use cached default scale in GetDefaultScaleInternal of Windows. r?jimm MozReview-Commit-ID: Ebm7h3h2mrg
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1091,17 +1091,17 @@ float nsWindow::GetDPI()
   return float(heightPx/heightInches);
 }
 
 double nsWindow::GetDefaultScaleInternal()
 {
   if (mDefaultScale <= 0.0) {
     mDefaultScale = WinUtils::LogToPhysFactor(mWnd);
   }
-  return WinUtils::LogToPhysFactor(mWnd);
+  return mDefaultScale;
 }
 
 int32_t nsWindow::LogToPhys(double aValue)
 {
   return WinUtils::LogToPhys(::MonitorFromWindow(mWnd,
                                                  MONITOR_DEFAULTTOPRIMARY),
                              aValue);
 }