4 ms·
Gnome actually always render a full framebuffer at integer scales and then downscale in GPU with bilinear scaling. 4K output, 1.5× scale means 6K framebuffer s
by kuschku 5y ago
Gnome actually always render a full framebuffer at integer scales and then downscale in GPU with bilinear scaling.
4K output, 1.5× scale means 6K framebuffer scaled to 4K.
That's sadly how it works at least on Gnome, and Gnome says they've copied it 1:1 from MacOS.
- hollerith 5y ago>Gnome actually always No, not always: when XFree86 and XWayland are out of the picture (i.e., when the app is talking directly to the Wayland protocol) there is no downscaling or upscaling at all. So, for example on Fedora 34 (my daily driver) if you say gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']" , then a new line (named "Scale") appears in the "Displays" pane of the Gnome "Settings" app. If you use that new line to set the scaling factor to 125% or 150% or 175%, then start google-chrome-stable or google-chrome-unstable with the flags -enable-features=UseOzonePlatform and -ozone-platform=wayland, then navigate to the page containing this comment, the "Y" in the upper left corner is a little blurry -- enough so that most people with non-hiDPI displays should be able to tell -- but everything else on the page, including the white box around the white "Y" and emphatically all the text is rendered directly at the correct resolution. This is because on a modern OS, the fonts are stored as resolution-independent mathematical descriptions of curves (splines, to be exact) that can be rendered cleanly at any resolution. And rounded corners specified by browser CSS or in GTK 3 or GTK 4 (the versions of GTK capable of communicating directly in the Wayland protocol) are specified in a resolution-independent way. And if the aforementioned white "Y" were a SVG file instead of a PNG file, it wouldn't be blurry either (but don't bother changing it, dang, it is fine the way it is). And all the Gnome apps, e.g., the aforementioned Settings app, e.g., Gnome Terminal, on my install are non-blurry at fractional scaling factors.
- Joeri 5y agoTo my knowledge windows is the only OS which renders the widgets at fractional scales and doesn't scale the output, but it only does it for apps which implement DPI awareness correctly. Some apps advertise to the OS they support DPI awareness, but then render controls at the wrong size. Others are GDI-based and don't support DPI awareness at all, and those are rendered 1x and scaled fractionally, which looks like a blurry mess.
- kuschku 5y agoAndroid and KDE use this method as well, which is very awesome as it provides the best performance and the best quality.
- rsynnott 5y agoInterestingly, early versions of MacOS 10 supported this as a hidden feature. It never really worked properly.
- Joeri 5y agoIt has never worked properly on windows either, but that hasn't prevented microsoft from shipping it. In fact, for a long time they didn't support per-monitor DPI awareness in the OS, so people with mixed DPI multi monitor setups had applications render at the wrong size or blurry when they moved them across. This was fixed in one of the windows 10 feature updates, and after that it was a patient wait for software to implement support for it. I believe MS Office 2019 was the version where it finally got correct support for it.
- danudey 5y agoWhen the MMO Star Wars: The Old Republic launched, I tried the beta and kept having issues where it would launch to a black screen, wait, and then crash. Someone, somewhere, figured out that the game only runs properly if you have the text scaling at 100%; I had it at 150% because I was playing on a TV and the screen was unreadable at 100%. I have to wonder what Microsoft did with text scaling that it broke a DirectX game.
- ziml77 5y agoJust made a comment about this recently, but a few year ago Microsoft added an enhanced GDI scaling mode. It applies the scaling during the GDI calls so it can render elements sharply. Obviously this won't magically make low-res images look better and it can't do anything about UI elements not rendered through GDI, but it's much better than just scaling the whole window up after it's rendered.
- kmeisthax 5y agoApple and GNOME do this to avoid rounding errors when working in scalable layouts defined as screen-width percentages. Web browsers have accumulated all sorts of tricks and hacks to ensure that, say, floating four 25% width columns always adds up to the same width as a 100% column. This isn't a particular failing of CSS or the web - though CSS floats absolutely make this so much of a problem that browsers have to actually correct for this when users scale pages. Exposing a 1x design to non-integer scale factors fundamentally runs the risk of breaking it - you will get odd pixel gaps or misalignments which would not occur at integer scales, because the virtual pixel coordinates no longer line up with actual screen pixels.
- kuschku 5y agoQt has done that for many years, so has Android, so has Windows. Only macOS and Gnome don't, because they value single-pixel alignment errors more than the massive performance issues and reduced sharpness their solutions cause.
- vetinari 5y agoAnd Qt after all those years does not work correctly in HiDPI. Not even on Windows. Unlike macOS and Gnome, which do.
- kuschku 5y agoGnome does NOT work correctly in HiDPI. I’ve got 3 systems with 1.5x scale, and Qt handles them perfectly fine (even with per-monitor separate scaling). While Gnome absolutely does not. Either I get absolutely unreadable tiny 1x, or I get absolutely unusable 2x with no space for anything. (That said, Qt on Windows handles per-screen scale factors very weirdly, especially with applications using pixel values)
- nextaccountic 5y agoIn my screen, 1x and 2x are both inadequate, but I'm using Gnome on Wayland on 1.25 scaling right now. Gnome can do fractional scaling. You just need to configure it with a gsettings command: https://www.linuxuprising.com/2019/04/how-to-enable-hidpi-fractional-scaling.html https://www.linuxuprising.com/2019/04/how-to-enable-hidpi-fr... https://wiki.archlinux.org/title/HiDPI#Fractional_scaling https://wiki.archlinux.org/title/HiDPI#Fractional_scaling Or using gnome-tweaks. Then, on display settings, it should show up the new scaling configs. And, in Gnome it's very sharp, with zero blurring! It was somehow sharper than whatever KDE was doing when I tested it some months ago.