[Qt-qml] on device performance
michael.brasser at nokia.com
michael.brasser at nokia.com
Thu Dec 16 00:01:53 CET 2010
Hi,
On 15/12/2010, at 9:02 PM, ext Cornelius Hald wrote:
> On Tue, 2010-12-14 at 15:59 +0100, Thomas Perl wrote:
>> How would a cross-platform "make it fast" code snippet look like that
>> gives the best result on both Maemo and Symbian^3 as well as on
>> Desktop platforms and future MeeGo devices?
>
> Even if we don't have fast cross-platform defaults, it would be
> interesting what the optimal settings are for the individual platforms.
> For example on Symbian^1 (XpressMusic 5880) I get horrible performance
> with the defaults.
>
> For Maemo5 I'm getting good (not great) performance with:
>
> #if defined(Q_WS_MAEMO_5)
> setAttribute(Qt::WA_OpaquePaintEvent);
> setAttribute(Qt::WA_NoSystemBackground);
> setViewport(new QGLWidget());
> setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
> #endif
If you aren't doing so already, I'd suggest also:
* running using the raster graphics system (i.e. raster + GL viewport). This has an impact because so many of the items cache their drawing to pixmaps.
* turning off sample buffers (below is what we do in qmlviewer), as long as the graphical results are acceptable to you
QGLFormat format = QGLFormat::defaultFormat();
format.setSampleBuffers(false);
QGLWidget *glWidget = new QGLWidget(format);
//### potentially faster, but causes junk to appear if top-level is Item, not Rectangle
//glWidget->setAutoFillBackground(false);
view->setViewport(glWidget);
* As mentioned in an earlier reply, running fullscreen rather than maximized if possible (compositing is quite expensive, and avoiding it gives a very nice performance bump)
Regards,
Michael
More information about the Qt-qml
mailing list