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

QtQuick software renderer does not work with fractional scaling factors

    XMLWordPrintable

Details

    • Windows

    Description

      Thanks to QTBUG-53022 5.14 will allow fractional devicePixelRatio values. When using OpenGL/Angle this works quite good - some artefacts due to scaling have to accepted.

      However using the software renderer now shows some serious rendering problems. Please see the attached screenshots:

      • real_application_extract.png shows the effect in a real application (this is only a part of the window).
      • example_xxx.png show the effect of the example program with different scale factors. Factor 2.x (200%) is fine.

      It looks as if the updated region calculation is also not working correctly with fractional scaling.

      With non-fractional scaling this does not seem to be a problem.

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.12 as C
      import QtQuick.Layouts 1.12
      
      Window {
          id: root
          visible: true
          width: 600
          height: 400
          title: qsTr("Hello World")
      
          ColumnLayout {
              anchors.centerIn: parent
              C.Label {
                  text: "devicePixelRatio " + Screen.devicePixelRatio
              }
              Grid {
                  flow: Grid.LeftToRight
                  spacing: 1
                  columns: 10
                  Repeater {
                      model: 100
                      Rectangle {
                          height: 30
                          width: 30
                          color: "blue"
                      }
                  }
              }
          }
      }
      
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      #include <QFont>
      
      int main(int argc, char *argv[])
      {
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      
      #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
        QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
      #endif
        QGuiApplication app(argc, argv);
      
        QFont f("Segoe UI");
        f.setPixelSize(12);
        app.setFont(f);
      
        QQmlApplicationEngine engine;
        const QUrl url(QStringLiteral("qrc:/main.qml"));
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                         &app, [url](QObject *obj, const QUrl &objUrl) {
          if (!obj && url == objUrl)
            QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        engine.load(url);
      
        return app.exec();
      }
      

      Attachments

        1. example_150.png
          example_150.png
          69 kB
        2. example_175.png
          example_175.png
          76 kB
        3. example_200.png
          example_200.png
          81 kB
        4. nodeDirtyRegion.png
          nodeDirtyRegion.png
          5 kB
        5. real_application_extract.png
          real_application_extract.png
          37 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            njeisecke Nils Jeisecke
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes