Fix calculation of QML_RENDER_TIMING values
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>
Fri, 7 Sep 2012 13:12:47 +0000 (15:12 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 10 Sep 2012 12:24:05 +0000 (14:24 +0200)
The sync time was not taken into account

Change-Id: I3d8adb637572c72438e20729a80513850a80d17e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Alan Alpert <416365416c@gmail.com>
src/quick/items/qquickthreadedwindowmanager.cpp
src/quick/items/qquickwindowmanager.cpp

index 653192b..04c698c 100644 (file)
@@ -477,10 +477,10 @@ void QQuickRenderThreadSingleContextWindowManager::run()
 #ifdef QQUICK_RENDER_TIMING
             if (qquick_render_timing()) {
                 static QTime lastFrameTime = QTime::currentTime();
-                swapTime = threadTimer.elapsed() - renderTime;
+                swapTime = threadTimer.elapsed() - renderTime - syncTime;
                 qDebug() << "- Breakdown of frame time; sync:" << syncTime
                          << "ms render:" << renderTime << "ms swap:" << swapTime
-                         << "ms total:" << swapTime + renderTime
+                         << "ms total:" << swapTime + renderTime + syncTime
                          << "ms time since last frame:" << (lastFrameTime.msecsTo(QTime::currentTime()))
                          << "ms";
                 lastFrameTime = QTime::currentTime();
index d864d72..4b36d9e 100644 (file)
@@ -262,10 +262,10 @@ void QQuickTrivialWindowManager::renderWindow(QQuickWindow *window)
 
     if (qquick_render_timing()) {
         static QTime lastFrameTime = QTime::currentTime();
-        const int swapTime = renderTimer.elapsed() - renderTime;
+        const int swapTime = renderTimer.elapsed() - renderTime - syncTime;
         qDebug() << "- Breakdown of frame time; sync:" << syncTime
                  << "ms render:" << renderTime << "ms swap:" << swapTime
-                 << "ms total:" << swapTime + renderTime
+                 << "ms total:" << swapTime + renderTime + syncTime
                  << "ms time since last frame:" << (lastFrameTime.msecsTo(QTime::currentTime()))
                  << "ms";
         lastFrameTime = QTime::currentTime();