7TV Paints #4149
-
Since 7TV support is going into upstream now, and I created the implementation for paints in their fork (SevenTV#89), I figured it would be best to create a new discussion topic for how they should be handled in upstream chatterino. On the most basic level I see 3 options for handling them:
I am not convinced if option 3, enabling them by default, is something that should even be considered, for the sole reason that gradients and especially drop shadows, which are a big part of paints, just don't look as good in Qt when comparing them to browser-based CSS rendering (Original PR contained an image for how all paints available while implementing it looked in chatterino). It's not awful or anything, but some just look kinda off. For the other 2 options, I can see both sides and honestly don't know myself which would be better. On the one hand, paints are a feature that some (or maybe a lot of, hard to know without actual numbers) people would want to enable, especially with 7TV's recent growth. But it is definitely a maintenance increase to have a different way of rendering usernames, which is a risk that would have to be assessed. I'm not really all that happy with the way I have implemented paints in that initial PR myself, it's a lot of code tucked onto MessageLayoutElement that should be more separated (https://github.com/SevenTV/chatterino7/pull/89/files#diff-6ed0beaea0a2d937c4fab7a47059363cdc988f2d94cf7dbd86a3a7a8d510f80b), but the core principle would probably stay around. Rendering paints is not hugely different from the current implementation, but there are some extra steps involved and it would require some more testers, since the initial PR did have scaling issues for a small number of people. In essence, what it comes down to is this:
It is a bit different for URL-Type paints, since those can also be animated images, they are drawn during the animation loop inside of TextLayoutElement::paintAnimated instead of the static TextLayoutElement::paint. Rendering the actual nametag is then the same process described in the 2 steps above. I'd say that the added complexity is not too bad, but the core maintainers are the ones who have to take the responsibility for a decision like that and should ultimately decide about the way moving forward. If paints are to be implemented, aside from refactoring the kinda messy rendering code currently inside of MessageLayoutElement, I think there would be a few more details to look at, other people can probably come up with different ones as well:
I would be happy to take on an eventual PR, I was looking for an excuse to improve my initial work anyways. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Given the amount of complexity for a feature that would not be available to all Chatterino users, I'm leaning towards option 1: Not supporting paints at all. |
Beta Was this translation helpful? Give feedback.
Given the amount of complexity for a feature that would not be available to all Chatterino users, I'm leaning towards option 1: Not supporting paints at all.