summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-06-30 11:21:56 +0200
committerJason Barron <jbarron@trolltech.com>2009-06-30 11:21:56 +0200
commit197df24edfe095a10e2bf65116796e027fea44e2 (patch)
tree4ffb08f614b550298663f90297c9e559ecb47a3c /tests/auto/qpainter
parent1e84894225e31adf80a7a33da7f655fb5c38ea0e (diff)
parente3c1039d4d10aa383a1f681e7dd9c1129d22d8ca (diff)
Merge commit 'qt/master-stable' into 4.6-merged
Conflicts: .gitignore configure.exe src/corelib/concurrent/qtconcurrentthreadengine.h src/corelib/global/qnamespace.h src/gui/graphicsview/qgraphicssceneevent.h src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.h src/gui/kernel/qapplication_p.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qwidget.h src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontdatabase.cpp src/network/access/qnetworkaccesshttpbackend.cpp tests/auto/network-settings.h tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro tests/auto/qvariant/tst_qvariant.cpp
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp44
-rw-r--r--tests/auto/qpainter/utils/createImages/main.cpp4
2 files changed, 44 insertions, 4 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 1fad8b5dc9..bbfa3e6a63 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -206,6 +206,7 @@ private slots:
void drawImage_task217400_data();
void drawImage_task217400();
+ void drawImage_1x1();
void drawRect_task215378();
void drawRect_task247505();
@@ -232,6 +233,7 @@ private slots:
void zeroOpacity();
void clippingBug();
+ void emptyClip();
private:
void fillData();
@@ -4221,5 +4223,43 @@ void tst_QPainter::clippingBug()
QCOMPARE(img, expected);
}
+void tst_QPainter::emptyClip()
+{
+ QImage img(64, 64, QImage::Format_ARGB32_Premultiplied);
+ QPainter p(&img);
+ p.setRenderHints(QPainter::Antialiasing);
+ p.setClipRect(0, 32, 64, 0);
+ p.fillRect(0, 0, 64, 64, Qt::white);
+
+ QPainterPath path;
+ path.lineTo(64, 0);
+ path.lineTo(64, 64);
+ path.lineTo(40, 64);
+ path.lineTo(40, 80);
+ path.lineTo(0, 80);
+
+ 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"
diff --git a/tests/auto/qpainter/utils/createImages/main.cpp b/tests/auto/qpainter/utils/createImages/main.cpp
index d38b48b9b2..9f4f767e89 100644
--- a/tests/auto/qpainter/utils/createImages/main.cpp
+++ b/tests/auto/qpainter/utils/createImages/main.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/