slint
slint copied to clipboard
Default backend selection depending on platform
Don't have Qt by default on non-linux
Make skia the default on non-wasm (but unfortunately still builds femtovg by default)
In order to have default feature dependent on the platform, one must use an intermediate crate
I'm putting this up for discussion. But I actually don't think it is a good idea to merge as is, because it will slow down compilation by building both skia and femtovg. Also Qt is the default but usually doesn't get enabled on Win and Mac anyway because it's not installed usually.
Yeah, I guess in practice this is a no-op on macOS, Windows, and wasm.
I acknowledge that once rust-skia built-in binaries don't apply, the barrier of entry for trying Slint increases a lot - and then the build time goes by a lot, too. The big advantage of femtovg is that it's the opposite: a super low barrier of entry for trying out Slint.
In my experience so far, we end up two tiers: It's easy to get going right now (especially if you don't have Qt installed) and for some users that's enough. And often for others we recommend "upgrading" to Skia, at which point it is a conscious choice and trade-offs are evaluated. I have the feeling that we could keep going with this strategy for a little longer.
The topic of the Qt backend is an entirely different one (with other issues such as complicating cross-compilation) and I think if we want to make changes there we need to agree on the styling first.
I think if we want to make changes there we need to agree on the styling first.
What do you mean agree on the styling? I though we already agreed in https://github.com/slint-ui/slint/issues/3431 (which is implemented: Qt is no longer the default style even if Qt is found on windows and mac)
I think if we want to make changes there we need to agree on the styling first.
What do you mean agree on the styling? I though we already agreed in #3431 (which is implemented: Qt is no longer the default style even if Qt is found on windows and mac)
Sorry, that came across wrongly. I'm only talking about Linux now. According to https://github.com/slint-ui/slint/issues/3431#issuecomment-1729684329 we need the Qt backend, which comes with benefits and trade-offs. Over time the benefits and trade-offs change, and so if we ever end up discussing those again, then it's possible that in the future we come to a different conclusion and perhaps technical solution as we did in #3431 . If that conclusion implies that we don't need the Qt style by default anymore, then what I was referring to talking - possibly making the qt backend not the default anymore on Linux - will become affected. Anyway, this isn't news - I don't to suggest changing anything in this PR. With this comment I merely want to clarify what I think we agree on: We can only make changes to the default Qt backend choice on Linux if we make changes to the default styling choice on Linux.
Note that a similar trick was done for the qt backend o linux only #4566 Now this PR is outdated but the question is whether skia should be the default backend.
Now this PR is outdated but the question is whether skia should be the default backend.
Since Qt is the default backend on Linux, that would mean either
- We make Skia work with the QWidget (possible by choice of software rendering)
or
- Skia would be the default renderer on macOS and Windows, on Linux QPainter would remain the default renderer
Either way, FemtoVG would remain the default for WASM builds.
- Skia would be the default renderer on macOS and Windows, on Linux QPainter would remain the default renderer
Yes. ... and femtoVG the default on wasm. (... and skia the default on linux if Qt is not found and always built)
Qt is already no longer built on non-linux. Changing the default renderer is not a good idea as skia is harder to build.