Bug 1423552: Use BaseRect access methods instead of member variables in hal/ r=gsvelto
authorMilan Sreckovic <milan@mozilla.com>
Wed, 10 Jan 2018 11:17:58 -0500
changeset 453341 0d6cff1374dc6f0863b73eabb899d4fcf918ab26
parent 453340 3d8b1409f0fe8606c4c80c4215c50b2efb6302cf
child 453342 40161b05e29e5561520b8d468c2ccd01b3e1ebd9
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsvelto
bugs1423552
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1423552: Use BaseRect access methods instead of member variables in hal/ r=gsvelto MozReview-Commit-ID: 625X8dMPL2n
hal/android/AndroidHal.cpp
hal/fallback/FallbackScreenConfiguration.h
--- a/hal/android/AndroidHal.cpp
+++ b/hal/android/AndroidHal.cpp
@@ -118,31 +118,34 @@ GetCurrentScreenConfiguration(ScreenConf
   nsresult rv;
   nsCOMPtr<nsIScreenManager> screenMgr =
     do_GetService("@mozilla.org/gfx/screenmanager;1", &rv);
   if (NS_FAILED(rv)) {
     NS_ERROR("Can't find nsIScreenManager!");
     return;
   }
 
-  nsIntRect rect;
   int32_t colorDepth, pixelDepth;
   int16_t angle;
   ScreenOrientationInternal orientation;
   nsCOMPtr<nsIScreen> screen;
 
+  int32_t rectX, rectY, rectWidth, rectHeight;
+
   screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
-  screen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height);
+  
+  screen->GetRect(&rectX, &rectY, &rectWidth, &rectHeight);
   screen->GetColorDepth(&colorDepth);
   screen->GetPixelDepth(&pixelDepth);
   orientation = static_cast<ScreenOrientationInternal>(bridge->GetScreenOrientation());
   angle = bridge->GetScreenAngle();
 
   *aScreenConfiguration =
-    hal::ScreenConfiguration(rect, orientation, angle, colorDepth, pixelDepth);
+    hal::ScreenConfiguration(nsIntRect(rectX, rectY, rectWidth, rectHeight),
+                             orientation, angle, colorDepth, pixelDepth);
 }
 
 bool
 LockScreenOrientation(const ScreenOrientationInternal& aOrientation)
 {
   // Force the default orientation to be portrait-primary.
   ScreenOrientationInternal orientation =
     aOrientation == eScreenOrientation_Default ? eScreenOrientation_PortraitPrimary
--- a/hal/fallback/FallbackScreenConfiguration.h
+++ b/hal/fallback/FallbackScreenConfiguration.h
@@ -19,29 +19,29 @@ GetCurrentScreenConfiguration(hal::Scree
   nsresult rv;
   nsCOMPtr<nsIScreenManager> screenMgr =
     do_GetService("@mozilla.org/gfx/screenmanager;1", &rv);
   if (NS_FAILED(rv)) {
     NS_ERROR("Can't find nsIScreenManager!");
     return;
   }
 
-  nsIntRect rect;
-  int32_t colorDepth, pixelDepth;
+  int32_t colorDepth, pixelDepth, x, y, w, h;
   dom::ScreenOrientationInternal orientation;
   nsCOMPtr<nsIScreen> screen;
 
   screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
-  screen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height);
+  screen->GetRect(&x, &y, &w, &h);
   screen->GetColorDepth(&colorDepth);
   screen->GetPixelDepth(&pixelDepth);
-  orientation = rect.width >= rect.height
+  orientation = w >= h
                 ? dom::eScreenOrientation_LandscapePrimary
                 : dom::eScreenOrientation_PortraitPrimary;
 
-  *aScreenConfiguration =
-      hal::ScreenConfiguration(rect, orientation, 0, colorDepth, pixelDepth);
+  *aScreenConfiguration = hal::ScreenConfiguration(nsIntRect(x, y, w, h),
+						   orientation, 0,
+						   colorDepth, pixelDepth);
 }
 
 }
 }
 
 #endif // mozilla_fallback_FallbackScreenConfiguration_h