mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 01:01:52 +00:00
Bug 878029 - Update GetDefaultScaleInternal() in Gonk to match AOSP spec. r=mwu
This commit is contained in:
parent
688c2390b7
commit
2536217acc
@ -547,12 +547,17 @@ nsWindow::GetDPI()
|
||||
double
|
||||
nsWindow::GetDefaultScaleInternal()
|
||||
{
|
||||
double rawscale = GetDPI() / 192.0;
|
||||
if (rawscale < 1.25)
|
||||
return 1;
|
||||
else if (rawscale < 1.75)
|
||||
return 1.5;
|
||||
return 2;
|
||||
float dpi = GetDPI();
|
||||
// The mean pixel density for mdpi devices is 160dpi, 240dpi for hdpi,
|
||||
// and 320dpi for xhdpi, respectively.
|
||||
// We'll take the mid-value between these three numbers as the boundary.
|
||||
if (dpi < 200.0) {
|
||||
return 1.0; // mdpi devices.
|
||||
}
|
||||
if (dpi < 280.0) {
|
||||
return 1.5; // hdpi devices.
|
||||
}
|
||||
return 2.0; // xhdpi devices.
|
||||
}
|
||||
|
||||
LayerManager *
|
||||
|
Loading…
Reference in New Issue
Block a user