Bug 1423552: Use BaseRect access methods instead of member variables in hal/ r=gsvelto

MozReview-Commit-ID: 625X8dMPL2n

--HG--
extra : rebase_source : ff2be1a73fe9bd0bead68078baa8fe4898a803c1
This commit is contained in:
Milan Sreckovic 2018-01-10 11:17:58 -05:00
Родитель 081f093fba
Коммит b600182b11
2 изменённых файлов: 12 добавлений и 9 удалений

Просмотреть файл

@ -123,21 +123,24 @@ GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration)
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

Просмотреть файл

@ -24,21 +24,21 @@ GetCurrentScreenConfiguration(hal::ScreenConfiguration* aScreenConfiguration)
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);
}
}