summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Hautakangas <jani.hautakangas@nokia.com>2011-01-11 13:26:22 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-01-13 12:24:36 (GMT)
commitb2e59b7340b1198cc9eacca51172d51e8048d2a7 (patch)
treeba044de63be54385b72b18f1cff0095beecef0bd
parent9bcdc472ba0035941159458b6db2a4c423fe1633 (diff)
downloadQt-b2e59b7340b1198cc9eacca51172d51e8048d2a7.zip
Qt-b2e59b7340b1198cc9eacca51172d51e8048d2a7.tar.gz
Qt-b2e59b7340b1198cc9eacca51172d51e8048d2a7.tar.bz2
Fix qglthreads test crash on Symbian
Use less GPU memory to make tests pass and skip threaded rendering since eventually tries to access main RWindow from secondary thread, which is not allowed on Symbian Task-number: QTBUG-13525 Reviewed-by: TRUSTME (cherry picked from commit e49868217e29f13dba28a2fe199d82268655b9fb)
-rw-r--r--tests/auto/qglthreads/tst_qglthreads.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/auto/qglthreads/tst_qglthreads.cpp b/tests/auto/qglthreads/tst_qglthreads.cpp
index 50152d1..0bcc4f6 100644
--- a/tests/auto/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/qglthreads/tst_qglthreads.cpp
@@ -51,9 +51,13 @@
#ifdef Q_OS_SYMBIAN
#include <unistd.h> // for usleep
+#define RUNNING_TIME 2000 // save GPU mem by running shorter time.
+#else
+#define RUNNING_TIME 5000
#endif
-#define RUNNING_TIME 5000
+
+
tst_QGLThreads::tst_QGLThreads(QObject *parent)
: QObject(parent)
@@ -205,7 +209,15 @@ public:
QTime time;
time.start();
while (time.elapsed() < RUNNING_TIME) {
- QImage image(400, 300, QImage::Format_RGB32);
+ int width = 400;
+ int height = 300;
+#ifdef Q_OS_SYMBIAN
+ // GPU mem is very scarce resource on Symbian currently.
+ // That's why we create only small textures.
+ width = 50;
+ height = 20;
+#else
+ QImage image(width, height, QImage::Format_RGB32);
QPainter p(&image);
p.fillRect(image.rect(), QColor(rand() % 256, rand() % 256, rand() % 256));
p.setPen(Qt::red);
@@ -434,6 +446,10 @@ void tst_QGLThreads::renderInThread()
QSKIP("OpenGL threading tests are currently disabled on mac as they were causing reboots", SkipAll);
#endif
+#ifdef Q_OS_SYMBIAN
+ QSKIP("OpenGL threading tests are disabled on Symbian as accessing RWindow from a secondary thread is not supported", SkipAll);
+#endif
+
QFETCH(bool, resize);
QFETCH(bool, update);