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

fillRect does not render correctly onto 16bpp image with scaling and antialias hint enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.0 Alpha
    • 4.7.3
    • GUI: Painting
    • None
    • Desktop
    • 2cf2f99ab1428b73d0531a4c6720a282bfef9fb0 (qt/qtbase/dev)

    Description

      fillRect produce light blue/green line artifacts when rendering to 16bpp image with scale + antialias hints enabled
      Test case:
      *********************************
      #include <QApplication>
      #include <QPainter>
      #include <QWidget>

      class myapp : public QWidget
      {
      Q_OBJECT
      public:
      myapp(QWidget *parent = 0)
      : QWidget(parent) {}

      protected:
      void paintEvent(QPaintEvent *event)
      {
      Q_UNUSED(event);
      QPainter painter(this);
      painter.fillRect(rect(), Qt::white);
      QImage image(rect().width(), rect().height(), QImage::Format_RGB16);
      QPainter mypainter(&image);
      mypainter.setRenderHint(QPainter::Antialiasing, true);
      mypainter.scale(0.873118, 0.873118);
      mypainter.fillRect(rect(), Qt::white);
      for (int i = 0; i < rect().height(); i+=6)

      { mypainter.fillRect(QRect(0,i,rect().width(),6), Qt::white); }

      painter.drawImage(QPoint(0, 0), image);
      }

      };

      int main(int argc, char *argv[])
      {
      QApplication app(argc, argv);

      myapp mapp;
      mapp.show();

      return app.exec();
      }
      *********************************

      Attachments

        1. blendFix.diff
          3 kB
        2. img.png
          img.png
          6 kB
        3. main.cpp
          1.0 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rodal Samuel Rødal
            romaxa Oleg Romashin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes