Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-29137

High CPU usage when the view containing animation is not shown

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.1.0
    • 5.0.0
    • GUI: Window management
    • 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(&#41;;
      }
      

      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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            xylosper Byoung-young Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes