summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-08 19:37:33 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-08 19:37:33 (GMT)
commit48b5fa29f5da3c241bc64520bd56ccd5713c4586 (patch)
tree2f812d575ee1e32ac60c391129ef25517fdec68f
parente2dcc68a6c8c94d7157c6ca662d1292f1dc295a4 (diff)
parent3110c9349503c2389f6aa4bcbfb78b28966549f1 (diff)
downloadQt-48b5fa29f5da3c241bc64520bd56ccd5713c4586.zip
Qt-48b5fa29f5da3c241bc64520bd56ccd5713c4586.tar.gz
Qt-48b5fa29f5da3c241bc64520bd56ccd5713c4586.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Add average frame timing to QDeclarativeView, ifdef'ed out.
-rw-r--r--src/declarative/util/qdeclarativeview.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index 8f06858..7b88610 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -702,6 +702,23 @@ void QDeclarativeView::paintEvent(QPaintEvent *event)
if (frameRateDebug())
qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time;
+
+#if QT_SHOW_DECLARATIVEVIEW_FPS
+ static QTime timer;
+ static int frames;
+
+ if (frames == 0) {
+ timer.start();
+ } else if (timer.elapsed() > 5000) {
+ qreal avgtime = timer.elapsed() / (qreal) frames;
+ qDebug("Average time per frame: %f ms (%i fps)", avgtime, int(1000 / avgtime));
+ timer.start();
+ frames = 0;
+ }
+ ++frames;
+ scene()->update();
+#endif
+
}
QT_END_NAMESPACE