Fix output of swap times for basic render loop
authorUlf Hermann <ulf.hermann@digia.com>
Tue, 1 Jul 2014 14:23:04 +0000 (16:23 +0200)
committerUlf Hermann <ulf.hermann@digia.com>
Wed, 2 Jul 2014 08:41:20 +0000 (10:41 +0200)
The swap time was treated as absolute by the qCDebug output, but was
actually relative.

Change-Id: Ia1539b8f8305ca37430022803419eb12a05934cb
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
src/quick/scenegraph/qsgrenderloop.cpp

index b4b4a6e..b4cfd1c 100644 (file)
@@ -396,7 +396,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
 
     qint64 swapTime = 0;
     if (profileFrames)
-        swapTime = renderTimer.nsecsElapsed() - renderTime;
+        swapTime = renderTimer.nsecsElapsed();
 
     if (QSG_LOG_TIME_RENDERLOOP().isDebugEnabled()) {
         static QTime lastFrameTime = QTime::currentTime();
@@ -414,7 +414,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
     Q_QUICK_SG_PROFILE(QQuickProfiler::SceneGraphRenderLoopFrame, (
             syncTime - polishTime,
             renderTime - syncTime,
-            swapTime));
+            swapTime - renderTime));
 
     // Might have been set during syncSceneGraph()
     if (data.updatePending)