[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:
parent
154528cdef
commit
ba2496ca12
3 changed files with 8 additions and 1 deletions
|
@ -321,6 +321,9 @@ void Decoration::init()
|
||||||
connect(m_view->contentItem(), &QQuickItem::heightChanged, m_item, updateSize);
|
connect(m_view->contentItem(), &QQuickItem::heightChanged, m_item, updateSize);
|
||||||
connect(m_view, &KWin::OffscreenQuickView::repaintNeeded, this, &Decoration::updateBuffer);
|
connect(m_view, &KWin::OffscreenQuickView::repaintNeeded, this, &Decoration::updateBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_supportsMask = m_item->property("supportsMask").toBool();
|
||||||
|
|
||||||
setupBorders(m_item);
|
setupBorders(m_item);
|
||||||
|
|
||||||
|
|
||||||
|
@ -572,7 +575,7 @@ void Decoration::updateExtendedBorders()
|
||||||
|
|
||||||
void Decoration::updateBlur()
|
void Decoration::updateBlur()
|
||||||
{
|
{
|
||||||
if (!m_item) {
|
if (!m_item || !m_supportsMask) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,8 @@ private:
|
||||||
void updateBuffer();
|
void updateBuffer();
|
||||||
void updateExtendedBorders();
|
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.
|
QRect m_contentRect; //the geometry of the part of the buffer that is not a shadow when buffer was created.
|
||||||
QQuickItem *m_item = nullptr;
|
QQuickItem *m_item = nullptr;
|
||||||
QQmlContext *m_qmlContext = nullptr;
|
QQmlContext *m_qmlContext = nullptr;
|
||||||
|
|
|
@ -11,6 +11,7 @@ Decoration {
|
||||||
id: root
|
id: root
|
||||||
property bool animate: false
|
property bool animate: false
|
||||||
property alias decorationMask: maskItem.mask
|
property alias decorationMask: maskItem.mask
|
||||||
|
property alias supportsMask: backgroundSvg.supportsMask
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
borders.left = Qt.binding(function() { return Math.max(0, auroraeTheme.borderLeft);});
|
borders.left = Qt.binding(function() { return Math.max(0, auroraeTheme.borderLeft);});
|
||||||
borders.right = Qt.binding(function() { return Math.max(0, auroraeTheme.borderRight);});
|
borders.right = Qt.binding(function() { return Math.max(0, auroraeTheme.borderRight);});
|
||||||
|
@ -42,6 +43,7 @@ Decoration {
|
||||||
}
|
}
|
||||||
PlasmaCore.FrameSvg {
|
PlasmaCore.FrameSvg {
|
||||||
property bool supportsInactive: hasElementPrefix("decoration-inactive")
|
property bool supportsInactive: hasElementPrefix("decoration-inactive")
|
||||||
|
property bool supportsMask: hasElementPrefix("mask")
|
||||||
property bool supportsMaximized: hasElementPrefix("decoration-maximized")
|
property bool supportsMaximized: hasElementPrefix("decoration-maximized")
|
||||||
property bool supportsMaximizedInactive: hasElementPrefix("decoration-maximized-inactive")
|
property bool supportsMaximizedInactive: hasElementPrefix("decoration-maximized-inactive")
|
||||||
property bool supportsInnerBorder: hasElementPrefix("innerborder")
|
property bool supportsInnerBorder: hasElementPrefix("innerborder")
|
||||||
|
|
Loading…
Reference in a new issue