Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
4.6.3, 4.7.0
-
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