I found that my application consumes more and more CPU power it time when making a simple animation.
I wrote a simple program so everyone could check what am i talking about:
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
ApplicationWindow {visible: true; width: 640; height: 480;
Window{ height: 100; width: 100; visible: true; objectName: "w1"; id:w1;
Image{anchors.fill: parent; source: sw?"qrc:/images/1":"qrc:/images/2"; }
}
Window{ height: 100; width: 100; visible: true; objectName: "w2"; id:w2;
Image{anchors.fill: parent; source: sw?"qrc:/images/1":"qrc:/images/2"; }
}
Window{ height: 100; width: 100; visible: true; objectName: "w3"; id:w3;
Image{anchors.fill: parent; source: sw?"qrc:/images/1":"qrc:/images/2"; }
}
property bool sw: false;
Timer { interval: 30;running: true;repeat: true;
onTriggered: {sw=!sw;}
}
}
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
ApplicationWindow {visible: true; width: 640; height: 480;
Window{ height: 100; width: 100; visible: true; objectName: "w1"; id:w1;
Image{anchors.fill: parent; source: sw?"qrc:/images/1":"qrc:/images/2"; }
}
Window{ height: 100; width: 100; visible: true; objectName: "w2"; id:w2;
Image{anchors.fill: parent; source: sw?"qrc:/images/1":"qrc:/images/2"; }
}
Window{ height: 100; width: 100; visible: true; objectName: "w3"; id:w3;
Image{anchors.fill: parent; source: sw?"qrc:/images/1":"qrc:/images/2"; }
}
property bool sw: false;
Timer { interval: 30;running: true;repeat: true;
onTriggered: {sw=!sw;}
}
}
To copy to clipboard, switch view to plain text mode
001.jpg
It happens only if animations is in few separate windows.
If i completely reload animated windows with Loader{}, everything resets and CPU load starts to increase from beginning.( but I can't use such quick fix in my program!)
If i reload only Image{} with Loader{}, it does not help.
It happens also if i creating custom QQuickPaintedItem in two or more QQuickWindows and calling them update() method. EVEN WITH NO ACTUAL DRAWING!!!
This issue was tested with Ubuntu 12.04+qt5.4.2+intel_video and ubuntu14.04+qt5.3.2+radeon_video.
I need a quick fix for this!!!
I had already tried to periodically call releaseResources() method and resetOpenGLState() method of QQuickWindow.
Can anyone test this issue or give me an advise?
Bookmarks