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:
parent
26505afbad
commit
5d922742fa
1 changed files with 25 additions and 17 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue