summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-09-08 11:33:46 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-09-08 11:33:46 (GMT)
commitbc02fbf402f922b41ae6ffb5ad3ede9101456a44 (patch)
tree8d35b5b13fb0fd948dc49b817ef06a907a19ed32 /tests/auto/qpainter
parentd2bbb8187688422d5104a85dc7f89215f5778f00 (diff)
parent4feb4019cfc144cef4cd9177d52e52dee9ebdf32 (diff)
downloadQt-bc02fbf402f922b41ae6ffb5ad3ede9101456a44.zip
Qt-bc02fbf402f922b41ae6ffb5ad3ede9101456a44.tar.gz
Qt-bc02fbf402f922b41ae6ffb5ad3ede9101456a44.tar.bz2
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index c9b5884..e434ed6 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_task258776();
void drawRect_task215378();
void drawRect_task247505();
@@ -3507,6 +3508,31 @@ void tst_QPainter::drawImage_task217400()
}
}
+void tst_QPainter::drawImage_task258776()
+{
+ QImage src(16, 16, QImage::Format_RGB888);
+ QImage dest(33, 33, QImage::Format_RGB888);
+ src.fill(0x00ff00);
+ dest.fill(0x0000ff);
+
+ QPainter painter(&dest);
+ painter.drawImage(QRectF(0.499, 0.499, 32, 32), src, QRectF(0, 0, 16, 16));
+ painter.end();
+
+ QImage expected(33, 33, QImage::Format_RGB32);
+ expected.fill(0xff0000);
+
+ painter.begin(&expected);
+ painter.drawImage(QRectF(0, 0, 32, 32), src);
+ painter.end();
+
+ dest = dest.convertToFormat(QImage::Format_RGB32);
+
+ dest.save("dest.png");
+ expected.save("expected.png");
+ QCOMPARE(dest, expected);
+}
+
void tst_QPainter::clipRectSaveRestore()
{
QImage img(64, 64, QImage::Format_ARGB32_Premultiplied);