From d02852416998d0765f3cb4c8a36c33ca046c34b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 17 Sep 2010 09:55:25 +0200 Subject: Make raster the default graphics system on X11. The raster graphicssystem in most cases performs better than the native graphicssystem. Results from tests/benchmarks/gui/painting/qtracebench below: Before change: RESULT : tst_QTraceBench::trace():"basicdrawing": 46 msecs RESULT : tst_QTraceBench::trace():"webkit": 20 msecs RESULT : tst_QTraceBench::trace():"creator": 62 msecs RESULT : tst_QTraceBench::trace():"textedit": 3 msecs RESULT : tst_QTraceBench::trace():"qmlphoneconcept": 713 msecs RESULT : tst_QTraceBench::trace():"qmlsamegame": 88 msecs After change: RESULT : tst_QTraceBench::trace():"basicdrawing": 40 msecs RESULT : tst_QTraceBench::trace():"webkit": 11 msecs RESULT : tst_QTraceBench::trace():"creator": 19 msecs RESULT : tst_QTraceBench::trace():"textedit": 5 msecs RESULT : tst_QTraceBench::trace():"qmlphoneconcept": 141 msecs RESULT : tst_QTraceBench::trace():"qmlsamegame": 3 msecs Reviewed-by: Gunnar Sletta --- src/gui/image/qpixmap.cpp | 5 +++++ src/gui/painting/qgraphicssystemfactory.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index d5db431..0445b46 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1170,7 +1170,12 @@ QPixmap QPixmap::grabWidget(QWidget * widget, const QRect &rect) \warning This function is X11 specific; using it is non-portable. + \warning Since 4.8, pixmaps do not have an X11 handle unless + created with \l {QPixmap::}{fromX11Pixmap()}, or if the native + graphics system is explicitly enabled. + \sa detach() + \sa QApplication::setGraphicsSystem() */ Qt::HANDLE QPixmap::handle() const diff --git a/src/gui/painting/qgraphicssystemfactory.cpp b/src/gui/painting/qgraphicssystemfactory.cpp index ee6fbd8..3adeba4 100644 --- a/src/gui/painting/qgraphicssystemfactory.cpp +++ b/src/gui/painting/qgraphicssystemfactory.cpp @@ -73,7 +73,7 @@ QGraphicsSystem *QGraphicsSystemFactory::create(const QString& key) if (system.isEmpty()) { system = QLatin1String("runtime"); } -#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) +#elif defined (QT_GRAPHICSSYSTEM_RASTER) && !defined(Q_WS_WIN) && !defined(Q_OS_SYMBIAN) || defined(Q_WS_X11) if (system.isEmpty()) { system = QLatin1String("raster"); } -- cgit v0.12