Rewrite svg engine

At the moment, SVG decoration themes are powered by the QML-based engine. It works but it is a very very very heavy tool, and there are inherent design issues that make fixing fractional scaling issues difficult.

This change re-writes the SVG engine without using QtQuick. The engine uses raw KDecoration APIs + KSvg, and surprisingly the code is not that complex. With this, kwin is finally no longer struggling when resizing or maximizing windows. By cutting out a middleman and having all the relevant tech stack under our control, we can also start looking into improving fractional scaling support.

The theme descriptions are cached. So when you open a new window, kwin won't go and re-parse the theme desciption again.

The way FrameSvg is used can be improved further, but given how the drop shadows are rendered currently, that won't have a significant improvement, and in fact, it'll regress some themes.

Note that this does not remove support for QML decorations, they are powered by a different engine instead.

While this change attempts to preserve compatibility with the previous implementation of SVG decorations as much as possible, it's still possible to observe some differences, but they should be very minimal. Nevertheless, if you use fractional scaling, you should already see fewer issues, e.g. no glitches in drop shadows, etc.


In the future, I'd like to add a separate prefix for drop shadows and also support for rounding bottom corners. This might be v3 though due to breaking changes.

Edited by Vlad Zahorodnii

Merge request reports

Loading