Avoid additional FBO rendering the blurred background

WindowThumbnails are image providers meaning it can provide textures
directly to ShaderEffects

layer.enabled is effectively a ShaderEffectSource meaning we render our
single desktop background item into an offscreen texture to ultimately
contain our desktop background.

We can cut out the middle-man and use the DesktopBackground as a source
directly saving a massive texture being generated.
This commit is contained in:
David Edmundson 2023-12-08 22:55:32 +00:00
parent 26505afbad
commit 5d922742fa

View file

@ -242,14 +242,21 @@ FocusScope {
}
Keys.priority: Keys.AfterItem
KWinComponents.DesktopBackground {
id: backgroundItem
activity: KWinComponents.Workspace.currentActivity
desktop: KWinComponents.Workspace.currentDesktop
outputName: targetScreen.name
layer.enabled: true
layer.effect: FastBlur {radius: 64}
Item {
width: backgroundItem.width
height: backgroundItem.height
KWinComponents.DesktopBackground {
id: backgroundItem
activity: KWinComponents.Workspace.currentActivity
desktop: KWinComponents.Workspace.currentDesktop
outputName: targetScreen.name
visible: false
}
FastBlur {
anchors.fill: parent
source: backgroundItem
radius: 64
}
}
Rectangle {
@ -515,15 +522,16 @@ FocusScope {
activity: KWinComponents.Workspace.currentActivity
desktop: KWinComponents.Workspace.currentDesktop
outputName: targetScreen.name
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
anchors.centerIn: parent
width: desktopElement.width
height: desktopElement.height
radius: mainBackground.radius
}
visible: false
}
OpacityMask {
anchors.fill: parent
source: desktopElement
maskSource: Rectangle {
anchors.centerIn: parent
width: desktopElement.width
height: desktopElement.height
radius: mainBackground.radius
}
}