summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-01-07 15:53:28 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-01-07 15:53:28 (GMT)
commit2dde31f712b5952838d867966d99565e1c7c825d (patch)
treeeccd6c518a81c696cc02bc738321a3b2d3f44a64 /tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
parent7a5bca82738e6b782047e50a813972eccd928307 (diff)
parentf8e08419c78e94d32273c8b039dd48dc9d5e3433 (diff)
downloadQt-2dde31f712b5952838d867966d99565e1c7c825d.zip
Qt-2dde31f712b5952838d867966d99565e1c7c825d.tar.gz
Qt-2dde31f712b5952838d867966d99565e1c7c825d.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Reset the GL stencil mask, op and function in resetGLState(). Fix performance regression in _q_polishItems. Fixed indentation and typo. Fixed bug in boxes demo occuring with certain OpenGL drivers. Remove unnecessary call to QWidget::setAttribute(). Avoid a deep copy of QImage::bits() in the png writer
Diffstat (limited to 'tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp')
-rw-r--r--tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
index 1944219..53fd9b6 100644
--- a/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/benchmarks/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -64,6 +64,7 @@ private slots:
void addItem();
void itemAt_data();
void itemAt();
+ void initialShow();
};
tst_QGraphicsScene::tst_QGraphicsScene()
@@ -227,5 +228,21 @@ void tst_QGraphicsScene::itemAt()
qApp->processEvents();
}
+void tst_QGraphicsScene::initialShow()
+{
+ QGraphicsScene scene;
+
+ QBENCHMARK {
+ for (int y = 0; y < 30000; ++y) {
+ QGraphicsRectItem *item = new QGraphicsRectItem(0, 0, 50, 50);
+ item->setPos((y/2) * item->rect().width(), (y/2) * item->rect().height());
+ scene.addItem(item);
+ }
+ scene.itemAt(0, 0); // triggers indexing
+ //This call polish the items so we bench their processing too.
+ qApp->processEvents();
+ }
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"