summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-22 09:03:39 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-22 09:03:39 (GMT)
commitb18f23bec4a046709d86386e18134fdaaa825552 (patch)
treea1e7bc7524ee3e9a2d18ffd88fde51ba8ec0cc9b /tests
parent252ea664604c85a5e993d28ee32d2aa0da7eca85 (diff)
parent18940f4953bfdc08b7ee8cfe9067ead6282b06a4 (diff)
downloadQt-b18f23bec4a046709d86386e18134fdaaa825552.zip
Qt-b18f23bec4a046709d86386e18134fdaaa825552.tar.gz
Qt-b18f23bec4a046709d86386e18134fdaaa825552.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 7e42da8..5e5bd39 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -202,6 +202,7 @@ private slots:
void drawImage_task217400_data();
void drawImage_task217400();
+ void drawImage_1x1();
void drawRect_task215378();
void drawRect_task247505();
@@ -4237,5 +4238,25 @@ void tst_QPainter::emptyClip()
p.fillPath(path, Qt::green);
}
+void tst_QPainter::drawImage_1x1()
+{
+ QImage source(1, 1, QImage::Format_ARGB32_Premultiplied);
+ source.fill(0xffffffff);
+
+ QImage img(32, 32, QImage::Format_ARGB32_Premultiplied);
+ img.fill(0xff000000);
+ QPainter p(&img);
+ p.drawImage(QRectF(0.9, 0.9, 32, 32), source);
+ p.end();
+
+ QImage expected = img;
+ expected.fill(0xff000000);
+ p.begin(&expected);
+ p.fillRect(1, 1, 31, 31, Qt::white);
+ p.end();
+
+ QCOMPARE(img, expected);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"