summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-02-06 12:55:55 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-02-06 16:57:41 +0000
commit91120599aee881bd1021087bae91fd1d5de46a4c (patch)
tree198ee11720146073e5fb3a868084f66c452241af /tests
parent4e5b013e32d8d6ca9b58d5f8476ceadb7c86dacc (diff)
QRasterPlatformPixmap::createPixmapForImage(): preserve DPR
Remove the line setting the DPR from the source; the image is moved. Task-number: QTBUG-58653 Task-number: QTBUG-58645 Change-Id: I2de94681459dba1d69dee06da44617fb9fa35bcc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 72609d4095..e3bda6c2df 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -119,6 +119,7 @@ private slots:
void refUnref();
void copy();
+ void deepCopyPreservesDpr();
void depthOfNullObjects();
void transformed();
@@ -1133,6 +1134,19 @@ void tst_QPixmap::copy()
QCOMPARE(trans, transCopy);
}
+// QTBUG-58653: Force a deep copy of a pixmap by
+// having a QPainter and check whether DevicePixelRatio is preserved
+void tst_QPixmap::deepCopyPreservesDpr()
+{
+ const qreal dpr = 2;
+ QPixmap src(32, 32);
+ src.setDevicePixelRatio(dpr);
+ src.fill(Qt::red);
+ QPainter painter(&src);
+ const QPixmap dest = src.copy();
+ QCOMPARE(dest.devicePixelRatio(), dpr);
+}
+
void tst_QPixmap::depthOfNullObjects()
{
QBitmap b1;