summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2009-09-09 03:45:11 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2009-09-09 03:45:11 (GMT)
commit8d37cc2a85f6aa1b9ca3ddc3a923befb4434c62c (patch)
tree98652a86fe2125ccb7a7c194b1e1da205f9eb79d /tests
parent39bcbc8df52eb5df5f7e39dc4265c8a77d3881be (diff)
parent4feb4019cfc144cef4cd9177d52e52dee9ebdf32 (diff)
downloadQt-8d37cc2a85f6aa1b9ca3ddc3a923befb4434c62c.zip
Qt-8d37cc2a85f6aa1b9ca3ddc3a923befb4434c62c.tar.gz
Qt-8d37cc2a85f6aa1b9ca3ddc3a923befb4434c62c.tar.bz2
Merge commit '4feb4019cfc144cef4cd9177d52e52dee9ebdf32' into 4.6
Conflicts: tests/auto/network-settings.h tests/auto/qpainter/tst_qpainter.cpp
Diffstat (limited to 'tests')
-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 fa3ea57..f66e00e 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -207,6 +207,7 @@ private slots:
void drawImage_task217400_data();
void drawImage_task217400();
void drawImage_1x1();
+ void drawImage_task258776();
void drawRect_task215378();
void drawRect_task247505();
@@ -3512,6 +3513,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);