summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmap
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-12-07 12:53:37 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2010-12-07 14:39:51 +0100
commiteac9e6a11e7727d8a749242f317362337ce89a1d (patch)
tree27e11cc2eec6863efdc5e86895c0cdbe3d4c5aba /tests/auto/qpixmap
parent532115bcaa370af827a5cbad017b272842c5aacf (diff)
Prevent always deep-copying in QPixmap::toImage() for raster pixmaps.
Calling paintEngine() can cause a deep copy since it will indirectly call the bits() function. Since we don't want to create a paint engine if it doesn't exist we should access the QImageData paintEngine variable directly instead. Reviewed-by: Olivier Goffart
Diffstat (limited to 'tests/auto/qpixmap')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index d5267b5dbd..419518a101 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -129,10 +129,7 @@ private slots:
void isNull();
void task_246446();
-#ifdef Q_WS_QWS
void convertFromImageNoDetach();
-#endif
-
void convertFromImageDetach();
#if defined(Q_WS_WIN)
@@ -913,11 +910,13 @@ void tst_QPixmap::isNull()
}
}
-#ifdef Q_WS_QWS
void tst_QPixmap::convertFromImageNoDetach()
{
+ QPixmap randomPixmap(10, 10);
+ if (randomPixmap.pixmapData()->classId() != QPixmapData::RasterClass)
+ QSKIP("Test only valid for raster pixmaps", SkipAll);
+
//first get the screen format
- QPixmap randomPixmap(10,10);
QImage::Format screenFormat = randomPixmap.toImage().format();
QVERIFY(screenFormat != QImage::Format_Invalid);
@@ -932,7 +931,6 @@ void tst_QPixmap::convertFromImageNoDetach()
const QImage constCopy = copy;
QVERIFY(constOrig.bits() == constCopy.bits());
}
-#endif //Q_WS_QWS
void tst_QPixmap::convertFromImageDetach()
{