summaryrefslogtreecommitdiffstats
path: root/tests/auto/qpainter
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-05-06 08:55:50 +0200
committeraxis <qt-info@nokia.com>2009-05-06 08:55:50 +0200
commitb246f8a8beab858468777f433f49faf62edcb07e (patch)
tree120844101aca654bf2f69fef5ea2647bf0bee13a /tests/auto/qpainter
parent5791fde8526afc49cdbeee080ead9e8a305e3cd5 (diff)
parenta1d2c3c589a03cc427dcc22d109003576add9500 (diff)
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 0cb8346f08..b813d1d801 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -229,6 +229,8 @@ private slots:
void extendedBlendModes();
+ void zeroOpacity();
+
private:
void fillData();
QColor baseColor( int k, int intensity=255 );
@@ -4153,5 +4155,21 @@ void tst_QPainter::extendedBlendModes()
QVERIFY(testCompositionMode(191, 191, 96, QPainter::CompositionMode_Exclusion));
}
+void tst_QPainter::zeroOpacity()
+{
+ QImage source(1, 1, QImage::Format_ARGB32_Premultiplied);
+ source.fill(0xffffffff);
+
+ QImage target(1, 1, QImage::Format_RGB32);
+ target.fill(0xff000000);
+
+ QPainter p(&target);
+ p.setOpacity(0.0);
+ p.drawImage(0, 0, source);
+ p.end();
+
+ QCOMPARE(target.pixel(0, 0), 0xff000000);
+}
+
QTEST_MAIN(tst_QPainter)
#include "tst_qpainter.moc"