summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-04-30 13:53:06 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-07-02 10:25:21 (GMT)
commit76a14c8254f4f8beb16de897f31bab13dc7609a4 (patch)
treea273511ff17a171c66372ef541e00d0b06bb0a0f
parent778ee2e9a2db3f3a1bc9d282356798baa77f6efd (diff)
downloadQt-76a14c8254f4f8beb16de897f31bab13dc7609a4.zip
Qt-76a14c8254f4f8beb16de897f31bab13dc7609a4.tar.gz
Qt-76a14c8254f4f8beb16de897f31bab13dc7609a4.tar.bz2
Check Qt::AA_X11InitThreads to determine pixmap usage in threads.
-rw-r--r--src/gui/painting/qpainter.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index ec2aca4..8ac40ee 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -155,6 +155,10 @@ static bool qt_painter_thread_test(int devType, const char *what, bool extraCond
#endif
break;
default:
+#ifdef Q_WS_X11
+ if (QApplication::testAttribute(Qt::AA_X11InitThreads))
+ return true;
+#endif
if (!extraCondition && QThread::currentThread() != qApp->thread()) {
qWarning("QPainter: It is not safe to use %s outside the GUI thread", what);
return false;
@@ -5252,8 +5256,7 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm)
return;
#ifndef QT_NO_DEBUG
- if (d->engine->type() != QPaintEngine::OpenGL2)
- qt_painter_thread_test(d->device->devType(), "drawPixmap()");
+ qt_painter_thread_test(d->device->devType(), "drawPixmap()");
#endif
if (d->extended) {
@@ -5323,8 +5326,7 @@ void QPainter::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
if (!d->engine || pm.isNull())
return;
#ifndef QT_NO_DEBUG
- if (d->engine->type() != QPaintEngine::OpenGL2)
- qt_painter_thread_test(d->device->devType(), "drawPixmap()");
+ qt_painter_thread_test(d->device->devType(), "drawPixmap()");
#endif
qreal x = r.x();
@@ -6668,8 +6670,7 @@ void QPainter::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPo
return;
#ifndef QT_NO_DEBUG
- if (d->engine->type() != QPaintEngine::OpenGL2)
- qt_painter_thread_test(d->device->devType(), "drawTiledPixmap()");
+ qt_painter_thread_test(d->device->devType(), "drawTiledPixmap()");
#endif
qreal sw = pixmap.width();