diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-11-08 16:33:49 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-11-08 16:51:34 (GMT) |
commit | 285855b8fbbdc7ad428a0c66f6c4469d97e55769 (patch) | |
tree | 41237f2f7b53bea0b3484a9907182240600366b3 /tests/auto/qpainter | |
parent | ee958e086847e2131f9b746e5c6de4491ae1f44b (diff) | |
download | Qt-285855b8fbbdc7ad428a0c66f6c4469d97e55769.zip Qt-285855b8fbbdc7ad428a0c66f6c4469d97e55769.tar.gz Qt-285855b8fbbdc7ad428a0c66f6c4469d97e55769.tar.bz2 |
Fixed text rendering bug in raster engine when opacity != 1.0.
If opacity is updated independently from the pen properties sometimes
the raster engine's fast_text flag would not be updated correctly,
causing it to use a rendering path which doesn't support alpha.
Reviewed-by: Robin Burchell
Reviewed-by: Andreas Kling
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r-- | tests/auto/qpainter/tst_qpainter.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index ff9bf1c..83ff9a9 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -256,6 +256,7 @@ private slots: void drawPointScaled(); void QTBUG14614_gradientCacheRaceCondition(); + void drawTextOpacity(); private: void fillData(); @@ -4576,6 +4577,30 @@ void tst_QPainter::QTBUG14614_gradientCacheRaceCondition() producers[i].wait(); } +void tst_QPainter::drawTextOpacity() +{ + QImage image(32, 32, QImage::Format_RGB32); + image.fill(0xffffffff); + + QPainter p(&image); + p.setPen(QColor("#6F6F6F")); + p.setOpacity(0.5); + p.drawText(5, 30, QLatin1String("Qt")); + p.end(); + + QImage copy = image; + image.fill(0xffffffff); + + p.begin(&image); + p.setPen(QColor("#6F6F6F")); + p.drawLine(-10, -10, -1, -1); + p.setOpacity(0.5); + p.drawText(5, 30, QLatin1String("Qt")); + p.end(); + + QCOMPARE(image, copy); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" |