[aurorae] do not make any blur calculations when blur is not supported

when an aurorae theme does not contain "mask" element we can safely assume that blur is not supported. In such case all blur calculations must not run at all. This will make all solid aurorae themes much lighter by default.
This commit is contained in:
Michail Vourlakos 2022-03-16 23:42:46 +00:00 committed by Nicolás Alvarez
parent 154528cdef
commit ba2496ca12
3 changed files with 8 additions and 1 deletions

View file

@ -321,6 +321,9 @@ void Decoration::init()
connect(m_view->contentItem(), &QQuickItem::heightChanged, m_item, updateSize);
connect(m_view, &KWin::OffscreenQuickView::repaintNeeded, this, &Decoration::updateBuffer);
}
m_supportsMask = m_item->property("supportsMask").toBool();
setupBorders(m_item);
@ -572,7 +575,7 @@ void Decoration::updateExtendedBorders()
void Decoration::updateBlur()
{
if (!m_item) {
if (!m_item || !m_supportsMask) {
return;
}

View file

@ -68,6 +68,8 @@ private:
void updateBuffer();
void updateExtendedBorders();
bool m_supportsMask{false};
QRect m_contentRect; //the geometry of the part of the buffer that is not a shadow when buffer was created.
QQuickItem *m_item = nullptr;
QQmlContext *m_qmlContext = nullptr;

View file

@ -11,6 +11,7 @@ Decoration {
id: root
property bool animate: false
property alias decorationMask: maskItem.mask
property alias supportsMask: backgroundSvg.supportsMask
Component.onCompleted: {
borders.left = Qt.binding(function() { return Math.max(0, auroraeTheme.borderLeft);});
borders.right = Qt.binding(function() { return Math.max(0, auroraeTheme.borderRight);});
@ -42,6 +43,7 @@ Decoration {
}
PlasmaCore.FrameSvg {
property bool supportsInactive: hasElementPrefix("decoration-inactive")
property bool supportsMask: hasElementPrefix("mask")
property bool supportsMaximized: hasElementPrefix("decoration-maximized")
property bool supportsMaximizedInactive: hasElementPrefix("decoration-maximized-inactive")
property bool supportsInnerBorder: hasElementPrefix("innerborder")