From 6063413330def9af3ef16a7a3a373284a15dddca Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Fri, 7 Sep 2012 15:12:47 +0200 Subject: [PATCH] Fix calculation of QML_RENDER_TIMING values The sync time was not taken into account Change-Id: I3d8adb637572c72438e20729a80513850a80d17e Reviewed-by: Sean Harmer Reviewed-by: Alan Alpert <416365416c@gmail.com> --- src/quick/items/qquickthreadedwindowmanager.cpp | 4 ++-- src/quick/items/qquickwindowmanager.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/quick/items/qquickthreadedwindowmanager.cpp b/src/quick/items/qquickthreadedwindowmanager.cpp index 653192b..04c698c 100644 --- a/src/quick/items/qquickthreadedwindowmanager.cpp +++ b/src/quick/items/qquickthreadedwindowmanager.cpp @@ -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(); diff --git a/src/quick/items/qquickwindowmanager.cpp b/src/quick/items/qquickwindowmanager.cpp index d864d72..4b36d9e 100644 --- a/src/quick/items/qquickwindowmanager.cpp +++ b/src/quick/items/qquickwindowmanager.cpp @@ -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(); -- 1.7.2.5