[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
eric at webkit.org
eric at webkit.org
Thu Feb 4 21:36:38 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 4b10030b5c8d102f4033f19a9e1910353f1331b0
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Feb 2 11:38:21 2010 +0000
2010-02-02 Noam Rosenthal <noam.rosenthal at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Enable a way to measure FPS in QGVLauncher
run QGVLauncher with --show-fps to see ongoing fps measurements
This is not meant as accurate FPS, but rather as a way to find
improvements/regressions
https://bugs.webkit.org/show_bug.cgi?id=34450
* QGVLauncher/main.cpp:
(MainView::MainView): initialize FPS values
(MainView::paintEvent): count a painted frame here
(MainView::printFps): we print the fps with qDebug every 5 seconds.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 170665a..63e4000 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-02 Noam Rosenthal <noam.rosenthal at nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Enable a way to measure FPS in QGVLauncher
+ run QGVLauncher with --show-fps to see ongoing fps measurements
+ This is not meant as accurate FPS, but rather as a way to find
+ improvements/regressions
+ https://bugs.webkit.org/show_bug.cgi?id=34450
+
+ * QGVLauncher/main.cpp:
+ (MainView::MainView): initialize FPS values
+ (MainView::paintEvent): count a painted frame here
+ (MainView::printFps): we print the fps with qDebug every 5 seconds.
+
2010-01-29 Ben Murdoch <benm at google.com>
Reviewed by Dimitri Glazkov.
diff --git a/WebKit/qt/QGVLauncher/main.cpp b/WebKit/qt/QGVLauncher/main.cpp
index eefff7f..0536af5 100644
--- a/WebKit/qt/QGVLauncher/main.cpp
+++ b/WebKit/qt/QGVLauncher/main.cpp
@@ -125,12 +125,22 @@ public:
MainView(QWidget* parent)
: QGraphicsView(parent)
, m_mainWidget(0)
+ , m_measureFps(QApplication::instance()->arguments().contains("--show-fps"))
+ , m_numTotalPaints(0)
+ , m_numPaintsSinceLastMeasure(0)
{
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setFrameShape(QFrame::NoFrame);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ if (m_measureFps) {
+ QTimer* fpsTimer = new QTimer(this);
+ fpsTimer->setInterval(5000);
+ m_totalStartTime = m_startTime = QTime::currentTime();
+ connect(fpsTimer, SIGNAL(timeout()), this, SLOT(printFps()));
+ fpsTimer->start();
+ }
}
void setMainWidget(QGraphicsWidget* widget)
@@ -149,6 +159,15 @@ public:
m_mainWidget->setGeometry(rect);
}
+ void paintEvent(QPaintEvent* event)
+ {
+ QGraphicsView::paintEvent(event);
+ if (m_measureFps) {
+ ++m_numPaintsSinceLastMeasure;
+ ++m_numTotalPaints;
+ }
+ }
+
void setWaitCursor()
{
m_mainWidget->setCursor(Qt::WaitCursor);
@@ -195,11 +214,29 @@ public slots:
emit flipRequest();
}
+ void printFps()
+ {
+ // note that this might have a bug if you measure right around midnight, but we can live with that
+ QTime now = QTime::currentTime();
+ int msecs = m_startTime.msecsTo(now);
+ int totalMsecs = m_totalStartTime.msecsTo(now);
+ int totalFps = totalMsecs ? m_numTotalPaints * 1000 / totalMsecs : 0;
+ int curFps = msecs ? m_numPaintsSinceLastMeasure * 1000 / msecs : 0;
+ qDebug("[FPS] From start: %d, from last paint: %d", totalFps, curFps);
+ m_startTime = now;
+ m_numPaintsSinceLastMeasure = 0;
+ }
+
signals:
void flipRequest();
private:
QGraphicsWidget* m_mainWidget;
+ bool m_measureFps;
+ int m_numTotalPaints;
+ int m_numPaintsSinceLastMeasure;
+ QTime m_startTime;
+ QTime m_totalStartTime;
};
class SharedScene : public QSharedData {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list