Hi!
I'm experiencing a horrible performance of the QGraphics
"accelerated" rendering when using the attached test program.
The program uses QGLWidget as a viewport when any command line parameter
is passed, and normal Qt rendering (software only?) otherwise.
When I run the application in my N900, it seems that the software
rendering is much smoother than the GL one.
Am I doing something wrong? I would expect much better performances,
with such a simple test application.
Any help is much appreciated (I'm trying to port Mappero to Qt :-) ).
Ciao,
Alberto
--
http://blog.mardy.it <- geek in un lingua international!
/*
* Compile with:
g++ -DQT_SHARED -I/usr/include/QtMaemo5 -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtOpenGL -g -O2 -o testgl -lQtMaemo5 -lQtOpenGL -lQtGui -lQtCore testgl.cpp
*/
#include <QApplication>
#include <QGLWidget>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QPixmap>
class MyGraphicsScene: public QGraphicsScene
{
void timerEvent(QTimerEvent *event)
{
static qreal angle = 0;
foreach (QGraphicsItem *item, items()) {
item->setRotation(angle);
}
angle += 1;
}
};
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyGraphicsScene scene;
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++) {
QPixmap pixmap = QPixmap(256, 256);
pixmap.fill(QColor(i * 80, j * 80, 0));
QGraphicsItem *item = scene.addPixmap(pixmap);
item->setPos(i * 256, j * 256);
}
QGraphicsView view(&scene );
view.setAttribute(Qt::WA_Maemo5AutoOrientation, true);
view.setAttribute(Qt::WA_Maemo5NonComposited, true);
view.setRenderHints(QPainter::Antialiasing);
if (argc > 1)
view.setViewport(new QGLWidget);
view.show();
scene.startTimer(10);
return app.exec();
}
_______________________________________________
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers