2 ms·
> Don't libraries like Skia, Qt, Cairo use GPU rendering? I've always assumed so. I mean, this is 2020, GPUs have been around for decades. As a Qt user / devel
by jcelerier 6y ago
> Don't libraries like Skia, Qt, Cairo use GPU rendering? I've always assumed so. I mean, this is 2020, GPUs have been around for decades.
As a Qt user / developer - you can use the GPU for your app, e.g. with Qt Quick or QGraphicsView, but there are sometimes good reasons to stick to CPU & software rendering, e.g. it is somewhat common to want to have intertwined "native" OS widgets (which are all CPU-rendered raster things) and custom GPU-drawn scene - this is a case where things fall a bit apart.
Another thing is that pretty, freetype-like font rendering is super expensive when you have a lot of text to show, and can't really be done (at least I have definitely not seen infinality-level beauty from the state of the art) on the GPU yet... next to that filling some rects (read: 95% of UI) with SSE/AVX/AVX2 as Qt does is stupidly fast.
- chrismorgan 6y ago> pretty, freetype-like font rendering is super expensive when you have a lot of text to show, and can't really be done (at least I have definitely not seen infinality-level beauty from the state of the art) on the GPU yet This is exactly what Pathfinder does. pcwalton is on this thread and is the main author of that. https://github.com/servo/pathfinder#features https://github.com/servo/pathfinder#features says: > Advanced font rendering. Pathfinder can render fonts with slight hinting and can perform subpixel antialiasing on LCD screens. It can do stem darkening/font dilation like macOS and FreeType in order to make text easier to read at small sizes. The library also has support for gamma correction.
- jcelerier 6y ago> This is exactly what Pathfinder does. from the screenshots I saw so far, pretty much not. > It can do stem darkening/font dilation like macOS and FreeType in order to make text easier to read at small sizes. there are tons of different ways to do that. Even freetype has a few different algorithms to do it, some not even merged if I'm not mistaken, which give wildly different results
- chrismorgan 6y agoTo give you an idea that pcwalton knows what he’s been doing and has indeed been seeking to match platform rendering exactly, here are a couple of tweets about the macOS font dilation: https://twitter.com/pcwalton/status/918593367914803201 https://twitter.com/pcwalton/status/918593367914803201, https://twitter.com/pcwalton/status/918991457532354560 https://twitter.com/pcwalton/status/918991457532354560. I rather like the demonstration of rendering including subpixel rendering at https://twitter.com/pcwalton/status/971475785616797698 https://twitter.com/pcwalton/status/971475785616797698, as well.
- jcelerier 6y ago> To give you an idea that pcwalton knows what he’s been doing and has indeed been seeking to match platform rendering exactly, I don't intend at all to cast doubt on pcwalton's abilities - the work is brilliant without any hesitation. But I wonder how that is possible given that "platform rendering" pretty much has changed every other macOS version and every Windows version ("ClearType" from WinXP is definitely not "ClearType" from Win10) ; and let's not talk about the customization abilities of freetype which makes rendering on any two linux boxes also entirely distinct.