diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-05 04:15:13 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-05 04:15:13 (GMT) |
commit | c98eafb1b6b100cf99518b33b8155aff866eb208 (patch) | |
tree | 464ff0a329dc02e01fa37310953a661c77a5f4bd /tests/auto/qpainter | |
parent | b59fb6e41ffe971c4f33a2595e10db2f8ecc9c15 (diff) | |
parent | 184a86f81711212fea21a827701eb4e95c37010b (diff) | |
download | Qt-c98eafb1b6b100cf99518b33b8155aff866eb208.zip Qt-c98eafb1b6b100cf99518b33b8155aff866eb208.tar.gz Qt-c98eafb1b6b100cf99518b33b8155aff866eb208.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging:
Fix BlendBench::unalignedBlendArgb32 test case
Fix memory leak in XSD component of XmlPatterns
Added autotest for threaded text rendering.
Implement support for enable_backup CONFIG value.
Make text rendering working outside the gui thread on Symbian.
Fix autotest failure in XmlPattern qxmlquery
Fix memory leak bugs in XmlPatterns
Symbian's QElapsedTimer::restart() fixed to return ms rather than us
Create a cleanup stack for each new thread on Symbian.
Do not modify window size for fullscreen windows in setGeometry_sys
Fixed Qt UDA creation for Symbian
Enablers for the Qt eclipsing in Symbian
Improve logic to find default certificates in createpackage script
Fix "make sis" for projects that have empty OBJECTS_DIR
Add focus frame support in style sheet
Fix OpenGL build break on Symbian
Diffstat (limited to 'tests/auto/qpainter')
-rw-r--r-- | tests/auto/qpainter/tst_qpainter.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 76bc5d63..9844434 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -72,6 +72,7 @@ #include <qgraphicsscene.h> #include <qgraphicsproxywidget.h> #include <qlayout.h> +#include <qfontdatabase.h> #if defined(Q_OS_SYMBIAN) # define SRCDIR "." @@ -266,6 +267,8 @@ private slots: void QTBUG17053_zeroDashPattern(); + void drawTextOutsideGuiThread(); + private: void fillData(); void setPenColor(QPainter& p); @@ -4739,6 +4742,44 @@ void tst_QPainter::QTBUG17053_zeroDashPattern() QCOMPARE(image, original); } +class TextDrawerThread : public QThread +{ +public: + void run(); + QImage rendering; +}; + +void TextDrawerThread::run() +{ + rendering = QImage(100, 100, QImage::Format_ARGB32_Premultiplied); + rendering.fill(0); + QPainter p(&rendering); + p.fillRect(10, 10, 100, 100, Qt::blue); + p.setPen(Qt::green); + p.drawText(20, 20, "some text"); + p.end(); +} + +void tst_QPainter::drawTextOutsideGuiThread() +{ + if (!QFontDatabase::supportsThreadedFontRendering()) + QSKIP("No threaded font rendering", SkipAll); + + QImage referenceRendering(100, 100, QImage::Format_ARGB32_Premultiplied); + referenceRendering.fill(0); + QPainter p(&referenceRendering); + p.fillRect(10, 10, 100, 100, Qt::blue); + p.setPen(Qt::green); + p.drawText(20, 20, "some text"); + p.end(); + + TextDrawerThread t; + t.start(); + t.wait(); + + QCOMPARE(referenceRendering, t.rendering); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" |