Bug 1423552: Use BaseRect access methods instead of member variables in hal/ r?gsvelto
MozReview-Commit-ID: 625X8dMPL2n
--- 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