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

[QDirectFBPixmapData] Image format and color depth is not set in transformed()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 4.6.3, 4.7.0
    • QPA: DirectFB
    • None
    • QWS with directfb gfx driver

    Description

      The problem: In QWS environment with directfb driver, it raise ASSERT exception after using QPainter on a scaled pixmap

      Test code:

          QPixmap pixmap1(50,50);
          pixmap1.fill(Qt::white);
      
          QPixmap pixmap2 = pixmap1.scaled(QSize(100,100));
      
          QPainter painter(&pixmap2);  // It raise ASSERT exception
      

      The result:

        ASSERT: "false" in file ../plugins/gfxdrivers/directfb/qdirectfbscreen.cpp, line 872
      

      The code raised the exception:

      int QDirectFBScreen::depth(QImage::Format format)
      {
          int depth = 0;
          switch(format) {
          case QImage::Format_Invalid:
          case QImage::NImageFormats:
              Q_ASSERT(false);
      

      After traced the code , I found that the QDirectFBPixmapData::transformed() function do not set the image format and color depth after transformed, there I have made a quick fix to this issue:
      http://qt.gitorious.org/qt/benlaus-qt-directfb-fix/commit/1297dbaccc4677d8d5337b59ce2b86df30dff1c7

      Attachments

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

        Activity

          People

            rve Anders Bakken
            benlau Ben Lau
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes