mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
wallpaper: vram optimizations
This commit is contained in:
@@ -89,6 +89,8 @@ Variants {
|
|||||||
property bool isInitialized: false
|
property bool isInitialized: false
|
||||||
property real transitionProgress: 0
|
property real transitionProgress: 0
|
||||||
readonly property bool transitioning: transitionAnimation.running
|
readonly property bool transitioning: transitionAnimation.running
|
||||||
|
property bool effectActive: false
|
||||||
|
property bool useNextForEffect: false
|
||||||
|
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
const isColor = source.startsWith("#");
|
const isColor = source.startsWith("#");
|
||||||
@@ -112,10 +114,21 @@ Variants {
|
|||||||
function setWallpaperImmediate(newSource) {
|
function setWallpaperImmediate(newSource) {
|
||||||
transitionAnimation.stop();
|
transitionAnimation.stop();
|
||||||
root.transitionProgress = 0.0;
|
root.transitionProgress = 0.0;
|
||||||
|
root.effectActive = false;
|
||||||
currentWallpaper.source = newSource;
|
currentWallpaper.source = newSource;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
currentWallpaper.opacity = 1;
|
}
|
||||||
nextWallpaper.opacity = 0;
|
|
||||||
|
function startTransition() {
|
||||||
|
currentWallpaper.cache = true;
|
||||||
|
nextWallpaper.cache = true;
|
||||||
|
root.useNextForEffect = true;
|
||||||
|
root.effectActive = true;
|
||||||
|
if (srcNext.scheduleUpdate)
|
||||||
|
srcNext.scheduleUpdate();
|
||||||
|
Qt.callLater(() => {
|
||||||
|
transitionAnimation.start();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeWallpaper(newPath) {
|
function changeWallpaper(newPath) {
|
||||||
@@ -126,6 +139,7 @@ Variants {
|
|||||||
if (root.transitioning) {
|
if (root.transitioning) {
|
||||||
transitionAnimation.stop();
|
transitionAnimation.stop();
|
||||||
root.transitionProgress = 0;
|
root.transitionProgress = 0;
|
||||||
|
root.effectActive = false;
|
||||||
currentWallpaper.source = nextWallpaper.source;
|
currentWallpaper.source = nextWallpaper.source;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
}
|
}
|
||||||
@@ -138,7 +152,7 @@ Variants {
|
|||||||
nextWallpaper.source = newPath;
|
nextWallpaper.source = newPath;
|
||||||
|
|
||||||
if (nextWallpaper.status === Image.Ready) {
|
if (nextWallpaper.status === Image.Ready) {
|
||||||
transitionAnimation.start();
|
root.startTransition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,6 +166,10 @@ Variants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property real screenScale: CompositorService.getScreenScale(modelData)
|
||||||
|
property int physicalWidth: Math.round(modelData.width * screenScale)
|
||||||
|
property int physicalHeight: Math.round(modelData.height * screenScale)
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: currentWallpaper
|
id: currentWallpaper
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -160,7 +178,7 @@ Variants {
|
|||||||
asynchronous: true
|
asynchronous: true
|
||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: true
|
||||||
sourceSize: Qt.size(modelData.width, modelData.height)
|
sourceSize: Qt.size(root.physicalWidth, root.physicalHeight)
|
||||||
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,19 +189,46 @@ Variants {
|
|||||||
opacity: 0
|
opacity: 0
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: false
|
||||||
sourceSize: Qt.size(modelData.width, modelData.height)
|
sourceSize: Qt.size(root.physicalWidth, root.physicalHeight)
|
||||||
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
||||||
|
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
if (status !== Image.Ready)
|
if (status !== Image.Ready)
|
||||||
return;
|
return;
|
||||||
if (!root.transitioning) {
|
if (!root.transitioning) {
|
||||||
transitionAnimation.start();
|
root.startTransition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShaderEffectSource {
|
||||||
|
id: srcNext
|
||||||
|
sourceItem: root.effectActive ? nextWallpaper : null
|
||||||
|
hideSource: root.effectActive
|
||||||
|
live: root.effectActive
|
||||||
|
mipmap: false
|
||||||
|
recursive: false
|
||||||
|
textureSize: root.effectActive ? Qt.size(root.physicalWidth, root.physicalHeight) : Qt.size(1, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: dummyRect
|
||||||
|
width: 1
|
||||||
|
height: 1
|
||||||
|
visible: false
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderEffectSource {
|
||||||
|
id: srcDummy
|
||||||
|
sourceItem: dummyRect
|
||||||
|
hideSource: true
|
||||||
|
live: false
|
||||||
|
mipmap: false
|
||||||
|
recursive: false
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: blurredLayer
|
id: blurredLayer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -201,8 +246,8 @@ Variants {
|
|||||||
|
|
||||||
MultiEffect {
|
MultiEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: nextWallpaper
|
source: root.useNextForEffect ? srcNext : srcDummy
|
||||||
visible: nextWallpaper.source !== ""
|
visible: nextWallpaper.source !== "" && root.useNextForEffect
|
||||||
blurEnabled: true
|
blurEnabled: true
|
||||||
blur: 0.8
|
blur: 0.8
|
||||||
blurMax: 75
|
blurMax: 75
|
||||||
@@ -220,16 +265,18 @@ Variants {
|
|||||||
duration: 1000
|
duration: 1000
|
||||||
easing.type: Easing.InOutCubic
|
easing.type: Easing.InOutCubic
|
||||||
onFinished: {
|
onFinished: {
|
||||||
const tempSource = nextWallpaper.source;
|
if (nextWallpaper.source && nextWallpaper.status === Image.Ready) {
|
||||||
if (tempSource && nextWallpaper.status === Image.Ready && !tempSource.toString().startsWith("#")) {
|
currentWallpaper.source = nextWallpaper.source;
|
||||||
currentWallpaper.source = tempSource;
|
|
||||||
}
|
}
|
||||||
root.transitionProgress = 0.0;
|
root.useNextForEffect = false;
|
||||||
currentWallpaper.opacity = 1;
|
|
||||||
nextWallpaper.opacity = 0;
|
|
||||||
|
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
|
Qt.callLater(() => {
|
||||||
|
root.effectActive = false;
|
||||||
|
currentWallpaper.cache = true;
|
||||||
|
nextWallpaper.cache = false;
|
||||||
|
root.transitionProgress = 0.0;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,12 +68,6 @@ Variants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onActualTransitionTypeChanged: {
|
|
||||||
if (actualTransitionType === "none") {
|
|
||||||
currentWallpaper.visible = true;
|
|
||||||
nextWallpaper.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
property real transitionProgress: 0
|
property real transitionProgress: 0
|
||||||
property real shaderFillMode: getFillMode(SettingsData.wallpaperFillMode)
|
property real shaderFillMode: getFillMode(SettingsData.wallpaperFillMode)
|
||||||
property vector4d fillColor: Qt.vector4d(0, 0, 0, 1)
|
property vector4d fillColor: Qt.vector4d(0, 0, 0, 1)
|
||||||
@@ -86,9 +80,8 @@ Variants {
|
|||||||
property real stripesAngle: 0
|
property real stripesAngle: 0
|
||||||
|
|
||||||
readonly property bool transitioning: transitionAnimation.running
|
readonly property bool transitioning: transitionAnimation.running
|
||||||
|
property bool effectActive: false
|
||||||
property bool hasCurrent: currentWallpaper.status === Image.Ready && !!currentWallpaper.source
|
property bool useNextForEffect: false
|
||||||
property bool booting: !hasCurrent && nextWallpaper.status === Image.Ready
|
|
||||||
|
|
||||||
function getFillMode(modeName) {
|
function getFillMode(modeName) {
|
||||||
switch (modeName) {
|
switch (modeName) {
|
||||||
@@ -143,10 +136,25 @@ Variants {
|
|||||||
function setWallpaperImmediate(newSource) {
|
function setWallpaperImmediate(newSource) {
|
||||||
transitionAnimation.stop();
|
transitionAnimation.stop();
|
||||||
root.transitionProgress = 0.0;
|
root.transitionProgress = 0.0;
|
||||||
|
root.effectActive = false;
|
||||||
currentWallpaper.source = newSource;
|
currentWallpaper.source = newSource;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
currentWallpaper.visible = true;
|
}
|
||||||
nextWallpaper.visible = false;
|
|
||||||
|
function startTransition() {
|
||||||
|
currentWallpaper.cache = true;
|
||||||
|
nextWallpaper.cache = true;
|
||||||
|
currentWallpaper.layer.enabled = true;
|
||||||
|
nextWallpaper.layer.enabled = true;
|
||||||
|
root.useNextForEffect = true;
|
||||||
|
root.effectActive = true;
|
||||||
|
if (srcCurrent.scheduleUpdate)
|
||||||
|
srcCurrent.scheduleUpdate();
|
||||||
|
if (srcNext.scheduleUpdate)
|
||||||
|
srcNext.scheduleUpdate();
|
||||||
|
Qt.callLater(() => {
|
||||||
|
transitionAnimation.start();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeWallpaper(newPath, force) {
|
function changeWallpaper(newPath, force) {
|
||||||
@@ -157,17 +165,16 @@ Variants {
|
|||||||
if (root.transitioning) {
|
if (root.transitioning) {
|
||||||
transitionAnimation.stop();
|
transitionAnimation.stop();
|
||||||
root.transitionProgress = 0;
|
root.transitionProgress = 0;
|
||||||
|
root.effectActive = false;
|
||||||
currentWallpaper.source = nextWallpaper.source;
|
currentWallpaper.source = nextWallpaper.source;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no current wallpaper, set immediately to avoid scaling issues
|
|
||||||
if (!currentWallpaper.source) {
|
if (!currentWallpaper.source) {
|
||||||
setWallpaperImmediate(newPath);
|
setWallpaperImmediate(newPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If transition is "none", set immediately
|
|
||||||
if (root.transitionType === "random") {
|
if (root.transitionType === "random") {
|
||||||
if (SessionData.includedTransitions.length === 0) {
|
if (SessionData.includedTransitions.length === 0) {
|
||||||
root.actualTransitionType = "none";
|
root.actualTransitionType = "none";
|
||||||
@@ -183,7 +190,7 @@ Variants {
|
|||||||
|
|
||||||
if (root.actualTransitionType === "wipe") {
|
if (root.actualTransitionType === "wipe") {
|
||||||
root.wipeDirection = Math.random() * 4;
|
root.wipeDirection = Math.random() * 4;
|
||||||
} else if (root.actualTransitionType === "disc") {
|
} else if (root.actualTransitionType === "disc" || root.actualTransitionType === "pixelate" || root.actualTransitionType === "portal") {
|
||||||
root.discCenterX = Math.random();
|
root.discCenterX = Math.random();
|
||||||
root.discCenterY = Math.random();
|
root.discCenterY = Math.random();
|
||||||
} else if (root.actualTransitionType === "stripes") {
|
} else if (root.actualTransitionType === "stripes") {
|
||||||
@@ -194,7 +201,7 @@ Variants {
|
|||||||
nextWallpaper.source = newPath;
|
nextWallpaper.source = newPath;
|
||||||
|
|
||||||
if (nextWallpaper.status === Image.Ready) {
|
if (nextWallpaper.status === Image.Ready) {
|
||||||
transitionAnimation.start();
|
root.startTransition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,41 +215,33 @@ Variants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
property real screenScale: CompositorService.getScreenScale(modelData)
|
||||||
id: transparentRect
|
property int physicalWidth: Math.round(modelData.width * screenScale)
|
||||||
anchors.fill: parent
|
property int physicalHeight: Math.round(modelData.height * screenScale)
|
||||||
color: "transparent"
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
|
|
||||||
ShaderEffectSource {
|
|
||||||
id: transparentSource
|
|
||||||
sourceItem: transparentRect
|
|
||||||
hideSource: true
|
|
||||||
live: false
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: currentWallpaper
|
id: currentWallpaper
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: root.actualTransitionType === "none"
|
visible: true
|
||||||
opacity: 1
|
opacity: 1
|
||||||
layer.enabled: false
|
layer.enabled: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: true
|
||||||
|
sourceSize: Qt.size(root.physicalWidth, root.physicalHeight)
|
||||||
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: nextWallpaper
|
id: nextWallpaper
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: false
|
visible: true
|
||||||
opacity: 0
|
opacity: 0
|
||||||
layer.enabled: false
|
layer.enabled: false
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: false
|
||||||
|
sourceSize: Qt.size(root.physicalWidth, root.physicalHeight)
|
||||||
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
||||||
|
|
||||||
onStatusChanged: {
|
onStatusChanged: {
|
||||||
@@ -252,19 +251,53 @@ Variants {
|
|||||||
currentWallpaper.source = source;
|
currentWallpaper.source = source;
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
root.transitionProgress = 0.0;
|
root.transitionProgress = 0.0;
|
||||||
} else {
|
} else if (!root.transitioning) {
|
||||||
visible = true;
|
root.startTransition();
|
||||||
if (!root.transitioning) {
|
|
||||||
transitionAnimation.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ShaderEffectSource {
|
||||||
|
id: srcCurrent
|
||||||
|
sourceItem: root.effectActive ? currentWallpaper : null
|
||||||
|
hideSource: root.effectActive
|
||||||
|
live: root.effectActive
|
||||||
|
mipmap: false
|
||||||
|
recursive: false
|
||||||
|
textureSize: root.effectActive ? Qt.size(root.physicalWidth, root.physicalHeight) : Qt.size(1, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderEffectSource {
|
||||||
|
id: srcNext
|
||||||
|
sourceItem: root.effectActive ? nextWallpaper : null
|
||||||
|
hideSource: root.effectActive
|
||||||
|
live: root.effectActive
|
||||||
|
mipmap: false
|
||||||
|
recursive: false
|
||||||
|
textureSize: root.effectActive ? Qt.size(root.physicalWidth, root.physicalHeight) : Qt.size(1, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: dummyRect
|
||||||
|
width: 1
|
||||||
|
height: 1
|
||||||
|
visible: false
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
ShaderEffectSource {
|
||||||
|
id: srcDummy
|
||||||
|
sourceItem: dummyRect
|
||||||
|
hideSource: true
|
||||||
|
live: false
|
||||||
|
mipmap: false
|
||||||
|
recursive: false
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: effectLoader
|
id: effectLoader
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
active: root.actualTransitionType !== "none" && (root.hasCurrent || root.booting)
|
active: root.effectActive
|
||||||
sourceComponent: {
|
sourceComponent: {
|
||||||
switch (root.actualTransitionType) {
|
switch (root.actualTransitionType) {
|
||||||
case "fade":
|
case "fade":
|
||||||
@@ -291,15 +324,15 @@ Variants {
|
|||||||
id: fadeComp
|
id: fadeComp
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property variant source1: root.hasCurrent ? currentWallpaper : transparentSource
|
property variant source1: srcCurrent
|
||||||
property variant source2: nextWallpaper
|
property variant source2: root.useNextForEffect ? srcNext : srcDummy
|
||||||
property real progress: root.transitionProgress
|
property real progress: root.transitionProgress
|
||||||
property real fillMode: root.shaderFillMode
|
property real fillMode: root.shaderFillMode
|
||||||
property vector4d fillColor: root.fillColor
|
property vector4d fillColor: root.fillColor
|
||||||
property real imageWidth1: Math.max(1, root.hasCurrent ? source1.sourceSize.width : modelData.width)
|
property real imageWidth1: modelData.width
|
||||||
property real imageHeight1: Math.max(1, root.hasCurrent ? source1.sourceSize.height : modelData.height)
|
property real imageHeight1: modelData.height
|
||||||
property real imageWidth2: Math.max(1, source2.sourceSize.width)
|
property real imageWidth2: modelData.width
|
||||||
property real imageHeight2: Math.max(1, source2.sourceSize.height)
|
property real imageHeight2: modelData.height
|
||||||
property real screenWidth: modelData.width
|
property real screenWidth: modelData.width
|
||||||
property real screenHeight: modelData.height
|
property real screenHeight: modelData.height
|
||||||
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_fade.frag.qsb")
|
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_fade.frag.qsb")
|
||||||
@@ -310,17 +343,17 @@ Variants {
|
|||||||
id: wipeComp
|
id: wipeComp
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property variant source1: root.hasCurrent ? currentWallpaper : transparentSource
|
property variant source1: srcCurrent
|
||||||
property variant source2: nextWallpaper
|
property variant source2: root.useNextForEffect ? srcNext : srcDummy
|
||||||
property real progress: root.transitionProgress
|
property real progress: root.transitionProgress
|
||||||
property real smoothness: root.edgeSmoothness
|
property real smoothness: root.edgeSmoothness
|
||||||
property real direction: root.wipeDirection
|
property real direction: root.wipeDirection
|
||||||
property real fillMode: root.shaderFillMode
|
property real fillMode: root.shaderFillMode
|
||||||
property vector4d fillColor: root.fillColor
|
property vector4d fillColor: root.fillColor
|
||||||
property real imageWidth1: Math.max(1, root.hasCurrent ? source1.sourceSize.width : modelData.width)
|
property real imageWidth1: modelData.width
|
||||||
property real imageHeight1: Math.max(1, root.hasCurrent ? source1.sourceSize.height : modelData.height)
|
property real imageHeight1: modelData.height
|
||||||
property real imageWidth2: Math.max(1, source2.sourceSize.width)
|
property real imageWidth2: modelData.width
|
||||||
property real imageHeight2: Math.max(1, source2.sourceSize.height)
|
property real imageHeight2: modelData.height
|
||||||
property real screenWidth: modelData.width
|
property real screenWidth: modelData.width
|
||||||
property real screenHeight: modelData.height
|
property real screenHeight: modelData.height
|
||||||
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_wipe.frag.qsb")
|
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_wipe.frag.qsb")
|
||||||
@@ -331,8 +364,8 @@ Variants {
|
|||||||
id: discComp
|
id: discComp
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property variant source1: root.hasCurrent ? currentWallpaper : transparentSource
|
property variant source1: srcCurrent
|
||||||
property variant source2: nextWallpaper
|
property variant source2: root.useNextForEffect ? srcNext : srcDummy
|
||||||
property real progress: root.transitionProgress
|
property real progress: root.transitionProgress
|
||||||
property real smoothness: root.edgeSmoothness
|
property real smoothness: root.edgeSmoothness
|
||||||
property real aspectRatio: root.width / root.height
|
property real aspectRatio: root.width / root.height
|
||||||
@@ -340,10 +373,10 @@ Variants {
|
|||||||
property real centerY: root.discCenterY
|
property real centerY: root.discCenterY
|
||||||
property real fillMode: root.shaderFillMode
|
property real fillMode: root.shaderFillMode
|
||||||
property vector4d fillColor: root.fillColor
|
property vector4d fillColor: root.fillColor
|
||||||
property real imageWidth1: Math.max(1, root.hasCurrent ? source1.sourceSize.width : modelData.width)
|
property real imageWidth1: modelData.width
|
||||||
property real imageHeight1: Math.max(1, root.hasCurrent ? source1.sourceSize.height : modelData.height)
|
property real imageHeight1: modelData.height
|
||||||
property real imageWidth2: Math.max(1, source2.sourceSize.width)
|
property real imageWidth2: modelData.width
|
||||||
property real imageHeight2: Math.max(1, source2.sourceSize.height)
|
property real imageHeight2: modelData.height
|
||||||
property real screenWidth: modelData.width
|
property real screenWidth: modelData.width
|
||||||
property real screenHeight: modelData.height
|
property real screenHeight: modelData.height
|
||||||
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_disc.frag.qsb")
|
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_disc.frag.qsb")
|
||||||
@@ -354,8 +387,8 @@ Variants {
|
|||||||
id: stripesComp
|
id: stripesComp
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property variant source1: root.hasCurrent ? currentWallpaper : transparentSource
|
property variant source1: srcCurrent
|
||||||
property variant source2: nextWallpaper
|
property variant source2: root.useNextForEffect ? srcNext : srcDummy
|
||||||
property real progress: root.transitionProgress
|
property real progress: root.transitionProgress
|
||||||
property real smoothness: root.edgeSmoothness
|
property real smoothness: root.edgeSmoothness
|
||||||
property real aspectRatio: root.width / root.height
|
property real aspectRatio: root.width / root.height
|
||||||
@@ -363,10 +396,10 @@ Variants {
|
|||||||
property real angle: root.stripesAngle
|
property real angle: root.stripesAngle
|
||||||
property real fillMode: root.shaderFillMode
|
property real fillMode: root.shaderFillMode
|
||||||
property vector4d fillColor: root.fillColor
|
property vector4d fillColor: root.fillColor
|
||||||
property real imageWidth1: Math.max(1, root.hasCurrent ? source1.sourceSize.width : modelData.width)
|
property real imageWidth1: modelData.width
|
||||||
property real imageHeight1: Math.max(1, root.hasCurrent ? source1.sourceSize.height : modelData.height)
|
property real imageHeight1: modelData.height
|
||||||
property real imageWidth2: Math.max(1, source2.sourceSize.width)
|
property real imageWidth2: modelData.width
|
||||||
property real imageHeight2: Math.max(1, source2.sourceSize.height)
|
property real imageHeight2: modelData.height
|
||||||
property real screenWidth: modelData.width
|
property real screenWidth: modelData.width
|
||||||
property real screenHeight: modelData.height
|
property real screenHeight: modelData.height
|
||||||
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_stripes.frag.qsb")
|
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_stripes.frag.qsb")
|
||||||
@@ -377,8 +410,8 @@ Variants {
|
|||||||
id: irisComp
|
id: irisComp
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property variant source1: root.hasCurrent ? currentWallpaper : transparentSource
|
property variant source1: srcCurrent
|
||||||
property variant source2: nextWallpaper
|
property variant source2: root.useNextForEffect ? srcNext : srcDummy
|
||||||
property real progress: root.transitionProgress
|
property real progress: root.transitionProgress
|
||||||
property real smoothness: root.edgeSmoothness
|
property real smoothness: root.edgeSmoothness
|
||||||
property real centerX: 0.5
|
property real centerX: 0.5
|
||||||
@@ -386,10 +419,10 @@ Variants {
|
|||||||
property real aspectRatio: root.width / root.height
|
property real aspectRatio: root.width / root.height
|
||||||
property real fillMode: root.shaderFillMode
|
property real fillMode: root.shaderFillMode
|
||||||
property vector4d fillColor: root.fillColor
|
property vector4d fillColor: root.fillColor
|
||||||
property real imageWidth1: Math.max(1, root.hasCurrent ? source1.sourceSize.width : modelData.width)
|
property real imageWidth1: modelData.width
|
||||||
property real imageHeight1: Math.max(1, root.hasCurrent ? source1.sourceSize.height : modelData.height)
|
property real imageHeight1: modelData.height
|
||||||
property real imageWidth2: Math.max(1, source2.sourceSize.width)
|
property real imageWidth2: modelData.width
|
||||||
property real imageHeight2: Math.max(1, source2.sourceSize.height)
|
property real imageHeight2: modelData.height
|
||||||
property real screenWidth: modelData.width
|
property real screenWidth: modelData.width
|
||||||
property real screenHeight: modelData.height
|
property real screenHeight: modelData.height
|
||||||
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_iris_bloom.frag.qsb")
|
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_iris_bloom.frag.qsb")
|
||||||
@@ -400,16 +433,16 @@ Variants {
|
|||||||
id: pixelateComp
|
id: pixelateComp
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property variant source1: root.hasCurrent ? currentWallpaper : transparentSource
|
property variant source1: srcCurrent
|
||||||
property variant source2: nextWallpaper
|
property variant source2: root.useNextForEffect ? srcNext : srcDummy
|
||||||
property real progress: root.transitionProgress
|
property real progress: root.transitionProgress
|
||||||
property real smoothness: root.edgeSmoothness
|
property real smoothness: root.edgeSmoothness
|
||||||
property real fillMode: root.shaderFillMode
|
property real fillMode: root.shaderFillMode
|
||||||
property vector4d fillColor: root.fillColor
|
property vector4d fillColor: root.fillColor
|
||||||
property real imageWidth1: Math.max(1, root.hasCurrent ? source1.sourceSize.width : modelData.width)
|
property real imageWidth1: modelData.width
|
||||||
property real imageHeight1: Math.max(1, root.hasCurrent ? source1.sourceSize.height : modelData.height)
|
property real imageHeight1: modelData.height
|
||||||
property real imageWidth2: Math.max(1, source2.sourceSize.width)
|
property real imageWidth2: modelData.width
|
||||||
property real imageHeight2: Math.max(1, source2.sourceSize.height)
|
property real imageHeight2: modelData.height
|
||||||
property real screenWidth: modelData.width
|
property real screenWidth: modelData.width
|
||||||
property real screenHeight: modelData.height
|
property real screenHeight: modelData.height
|
||||||
property real centerX: root.discCenterX
|
property real centerX: root.discCenterX
|
||||||
@@ -423,8 +456,8 @@ Variants {
|
|||||||
id: portalComp
|
id: portalComp
|
||||||
ShaderEffect {
|
ShaderEffect {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
property variant source1: root.hasCurrent ? currentWallpaper : transparentSource
|
property variant source1: srcCurrent
|
||||||
property variant source2: nextWallpaper
|
property variant source2: root.useNextForEffect ? srcNext : srcDummy
|
||||||
property real progress: root.transitionProgress
|
property real progress: root.transitionProgress
|
||||||
property real smoothness: root.edgeSmoothness
|
property real smoothness: root.edgeSmoothness
|
||||||
property real aspectRatio: root.width / root.height
|
property real aspectRatio: root.width / root.height
|
||||||
@@ -432,10 +465,10 @@ Variants {
|
|||||||
property real centerY: root.discCenterY
|
property real centerY: root.discCenterY
|
||||||
property real fillMode: root.shaderFillMode
|
property real fillMode: root.shaderFillMode
|
||||||
property vector4d fillColor: root.fillColor
|
property vector4d fillColor: root.fillColor
|
||||||
property real imageWidth1: Math.max(1, root.hasCurrent ? source1.sourceSize.width : modelData.width)
|
property real imageWidth1: modelData.width
|
||||||
property real imageHeight1: Math.max(1, root.hasCurrent ? source1.sourceSize.height : modelData.height)
|
property real imageHeight1: modelData.height
|
||||||
property real imageWidth2: Math.max(1, source2.sourceSize.width)
|
property real imageWidth2: modelData.width
|
||||||
property real imageHeight2: Math.max(1, source2.sourceSize.height)
|
property real imageHeight2: modelData.height
|
||||||
property real screenWidth: modelData.width
|
property real screenWidth: modelData.width
|
||||||
property real screenHeight: modelData.height
|
property real screenHeight: modelData.height
|
||||||
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_portal.frag.qsb")
|
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/wp_portal.frag.qsb")
|
||||||
@@ -451,14 +484,20 @@ Variants {
|
|||||||
duration: root.actualTransitionType === "none" ? 0 : 1000
|
duration: root.actualTransitionType === "none" ? 0 : 1000
|
||||||
easing.type: Easing.InOutCubic
|
easing.type: Easing.InOutCubic
|
||||||
onFinished: {
|
onFinished: {
|
||||||
|
if (nextWallpaper.source && nextWallpaper.status === Image.Ready) {
|
||||||
|
currentWallpaper.source = nextWallpaper.source;
|
||||||
|
}
|
||||||
|
root.useNextForEffect = false;
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
if (nextWallpaper.source && nextWallpaper.status === Image.Ready && !nextWallpaper.source.toString().startsWith("#")) {
|
|
||||||
currentWallpaper.source = nextWallpaper.source;
|
|
||||||
}
|
|
||||||
nextWallpaper.source = "";
|
nextWallpaper.source = "";
|
||||||
nextWallpaper.visible = false;
|
Qt.callLater(() => {
|
||||||
currentWallpaper.visible = root.actualTransitionType === "none";
|
root.effectActive = false;
|
||||||
root.transitionProgress = 0.0;
|
currentWallpaper.layer.enabled = false;
|
||||||
|
nextWallpaper.layer.enabled = false;
|
||||||
|
currentWallpaper.cache = true;
|
||||||
|
nextWallpaper.cache = false;
|
||||||
|
root.transitionProgress = 0.0;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user