bug 1271893 add a 1.5 pixel-scaling step r=acomminos

The only change in behaviour introduced here is that dpi values in the
range [144,168) will now use pixel scaling of 1.5 instead of 2.

MozReview-Commit-ID: JD6FcZGLYtI

--HG--
extra : rebase_source : ebddf46ba6e9b8a478fb2fffabc7cf1ca8ed8c81
This commit is contained in:
Karl Tomlinson 2016-05-11 09:21:13 +12:00
Родитель 8d74a6e68f
Коммит 294a905269
1 изменённых файлов: 12 добавлений и 4 удалений

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

@ -340,11 +340,19 @@ gfxPlatformGtk::GetDPI()
double
gfxPlatformGtk::GetDPIScale()
{
// We want to set the default CSS to device pixel ratio as the
// closest _integer_ multiple, so round the ratio of actual dpi
// to CSS dpi (96)
// Integer scale factors work well with GTK window scaling, image scaling,
// and pixel alignment, but there is a range where 1 is too small and 2 is
// too big. An additional step of 1.5 is added because this is common
// scale on WINNT and at this ratio the advantages of larger rendering
// outweigh the disadvantages from scaling and pixel mis-alignment.
int32_t dpi = GetDPI();
return (dpi > 96) ? round(dpi/96.0) : 1.0;
if (dpi < 144) {
return 1.0;
} else if (dpi < 168) {
return 1.5;
} else {
return round(dpi/96.0);
}
}
bool