Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
OS: Mac OS X 10.7.5, CPU: 2.7GHz Intel Core i7, Memory: 8GB DDR3, GPU: Intel HD 3000 512MB
Description
Summary:
When a QQuickView whose source contains animation is not shown by,
1. being minimized,
2. or, being covered by any other windows,
the CPU usage of program is way too high.
Here's a very simple QML code including an animation:
import QtQuick 2.0 Rectangle { ColorAnimation on color { loops: Animation.Infinite; from: "white"; to: "black"; duration: 5000 } }
I executed this qml code with next C++ code:
#include <QGuiApplication> #include <QQuickView> int main(int argc, char **argv) { QGuiApplication app(argc, argv); QQuickView view; view.setSource(QUrl::fromLocalFile("/path/to/qml")); view.setResizeMode(QQuickView::SizeRootObjectToView); view.resize(100, 100); view.show(); return app.exec(); }
As far as I'm seeing the scene, there's no problem and the CPU usage hits only about 5%.
However, the window is hidden by being minimized or covered other windows, the CPU usage reaches to about 90%.
If I recover the window shown normal, CPU usage also decreses to normal percentage(<5%).
Without animantions, the problem does not occur.