summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-06-04 19:24:49 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-06-04 19:24:49 +0200
commit5c17f3abe1c43539db613da78414bc0b27928814 (patch)
treeaeda95c710a5dd597d4e45a94f57729f0dc1a6dc /tests/auto/qpainter
parentb70c535fb096652def0c4f6df6f9cd2827fa9c97 (diff)
parent398c022e8adefc6e71a6048da40c19f6169be831 (diff)
Merge commit 'origin/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 af0f6cfc07..c0f9935fd3 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -215,6 +215,7 @@ private slots:
void imageCoordinateLimit();
void imageBlending_data();
void imageBlending();
+ void imageBlending_clipped();
void paintOnNullPixmap();
void checkCompositionMode();
@@ -3793,6 +3794,31 @@ void tst_QPainter::imageBlending()
}
}
+void tst_QPainter::imageBlending_clipped()
+{
+ QImage src(20, 20, QImage::Format_RGB16);
+ QPainter p(&src);
+ p.fillRect(src.rect(), Qt::red);
+ p.end();
+
+ QImage dst(40, 20, QImage::Format_RGB16);
+ p.begin(&dst);
+ p.fillRect(dst.rect(), Qt::white);
+ p.end();
+
+ QImage expected = dst;
+
+ p.begin(&dst);
+ p.setClipRect(QRect(23, 0, 20, 20));
+
+ // should be completely clipped
+ p.drawImage(QRectF(3, 0, 20, 20), src);
+ p.end();
+
+ // dst should be left unchanged
+ QCOMPARE(dst, expected);
+}
+
void tst_QPainter::paintOnNullPixmap()
{
QPixmap pix(16, 16);