summaryrefslogtreecommitdiffstats
path: root/WebKitTools/QtTestBrowser/fpstimer.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-11-04 12:00:17 -0700
committerJohn Reck <jreck@google.com>2010-11-09 11:35:04 -0800
commite14391e94c850b8bd03680c23b38978db68687a8 (patch)
tree3fed87e6620fecaf3edc7259ae58a11662bedcb2 /WebKitTools/QtTestBrowser/fpstimer.cpp
parent1bd705833a68f07850cf7e204b26f8d328d16951 (diff)
downloadexternal_webkit-e14391e94c850b8bd03680c23b38978db68687a8.zip
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.gz
external_webkit-e14391e94c850b8bd03680c23b38978db68687a8.tar.bz2
Merge Webkit at r70949: Initial merge by git.
Change-Id: I77b8645c083b5d0da8dba73ed01d4014aab9848e
Diffstat (limited to 'WebKitTools/QtTestBrowser/fpstimer.cpp')
-rw-r--r--WebKitTools/QtTestBrowser/fpstimer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/WebKitTools/QtTestBrowser/fpstimer.cpp b/WebKitTools/QtTestBrowser/fpstimer.cpp
index 3b72cef..eae3d9c 100644
--- a/WebKitTools/QtTestBrowser/fpstimer.cpp
+++ b/WebKitTools/QtTestBrowser/fpstimer.cpp
@@ -37,11 +37,12 @@
#define FPS_MEASURE_INTERVAL 1000 / 60
FpsTimer::FpsTimer(QObject* parent)
- : QObject(parent)
+ : QObject(parent)
+ , m_timer(0)
{
}
-int FpsTimer::numFrames(int spanMillis)
+int FpsTimer::numFrames(int spanMillis) const
{
const QTime now = QTime::currentTime();
@@ -63,13 +64,15 @@ void FpsTimer::start()
void FpsTimer::stop()
{
+ if (!m_timer)
+ return;
killTimer(m_timer);
m_frames.clear();
}
void FpsTimer::timerEvent(QTimerEvent* event)
{
- if (event->timerId() != m_timer)
+ if (event->timerId() != m_timer)
return;
m_frames.append(QTime::currentTime());
if (m_frames.length() > MAX_FRAMES_SAVED)