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

void QColorLuminancePicker::paintEvent() is very slow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.3.0
    • 5.2.0
    • None
    • Android 4.3
    • Streamline paint event: fa83803119296c2224cf1c7fb7474057a77aa51b (dev, 29.1.2014, 5.3)

    Description

      QColorLuminancePicker::paintEvent() is slow. This probably would never be that noticeable except that I resized QColorLuminancePicker so it is more usable on Android, and it runs very slow.

      When I looked at the code I noticed that there is code in the inner-most loop that should be in the loop one back... That should speed up the function quite a bit without rewriting the whole thing.

      Currently:
      for (y = 0; y < hi; y++) {
      const uint *end = pixel + wi;
      while (pixel < end)

      { QColor c; c.setHsv(hue, sat, y2val(y+coff)); *pixel = c.rgb(); ++pixel; }

      }

      Should be:
      for (y = 0; y < hi; y++) {
      const uint *end = pixel + wi;
      QColor c;
      c.setHsv(hue, sat, y2val(y+coff));
      while (pixel < end)

      { *pixel = c.rgb(); ++pixel; }

      }

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            jgrauman Joshua Grauman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes