зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
8d74a6e68f
Коммит
294a905269
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче