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

drawPolyLine very slow on large windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.7.1
    • GUI: Painting
    • None
    • kubuntu 17.04 with the backports ppa version of Qt 5.7.1

      Dell xps 15 9560 (2017)

      nvidia  GTX 1050 Mobile or intel graphics

      g++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406

    Description

      Problem:

      In the following code snippet, poly is a 100 point QPolygon which describes a zigzag covering most of the window.

      When:

      • width > 1.0 and
      • p->window().width * p->window.height() > ~2200000

      then the time to do the drawPolyLine is extremely long (several seconds) instead of several ms.

      Other observations

      The change is sudden as the window size is increased past the limit (which depends weakly on the aspect ratio of the window)

      Because the window is so large, this is only seen on high DPI (4k) screents.

      This is not seen when compiled in qt4, but I haven't checked in any other versions.

      Turning off antialiasing does not get rid of the problem.

      Changing between intel graphics and nvida graphics does not change this.

      Drawing each of the line segments in poly using p->drawLine(poly[i], poly[i+1]) instead of using drawPolyLine() does remove the problem - it remains  fast (a couple ms) for any size window up to 4k.

      Code Snippet:

      p is a painter drawing into a QGraphicsRectItem

        p->setPen(QPen(color(), _width, style));
        p->drawPolyline(poly);

       

      Attachments

        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
            netterfield Barth Netterfield
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes