diff options
author | jiu <shanheng.jiu@qt.io> | 2020-08-26 15:22:36 +0900 |
---|---|---|
committer | shanheng.jiu <shanheng.jiu@qt.io> | 2020-08-31 10:55:14 +0000 |
commit | 0e8dfe18767c16f7d84a4ce1a887f6e37a13ed33 (patch) | |
tree | 859ebfd5c94626106801849a7ba11bf483c30fa1 /src/quick/scenegraph | |
parent | 22234c8a469be7c831aab51c9705e06f8624d24e (diff) |
Fix qt.scenegraph.time.renderloop time log
Fixes: QTBUG-86209
Change-Id: Iea09d22f09df3b50ebdf55d1c72affb5603bdcda
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph')
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 14 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index f7cbdd6292..6f83085745 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -714,7 +714,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window) int(polishTime / 1000000), int((syncTime - polishTime) / 1000000), int((renderTime - syncTime) / 1000000), - int((swapTime - renderTime) / 10000000), + int((swapTime - renderTime) / 1000000), int(lastFrameTime.msecsTo(QTime::currentTime()))); lastFrameTime = QTime::currentTime(); } diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 61ec505ca1..ea7da77870 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -128,12 +128,6 @@ static inline int qsgrl_animation_interval() { return int(1000 / refreshRate); } - -static QElapsedTimer threadTimer; -static qint64 syncTime; -static qint64 renderTime; -static qint64 sinceLastTime; - extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha); // RL: Render Loop @@ -642,10 +636,10 @@ void QSGRenderThread::handleDeviceLoss() void QSGRenderThread::syncAndRender(QImage *grabImage) { bool profileFrames = QSG_LOG_TIME_RENDERLOOP().isDebugEnabled(); - if (profileFrames) { - sinceLastTime = threadTimer.nsecsElapsed(); + QElapsedTimer threadTimer; + qint64 syncTime = 0, renderTime = 0; + if (profileFrames) threadTimer.start(); - } Q_TRACE_SCOPE(QSG_syncAndRender); Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphRenderLoopFrame); Q_TRACE(QSG_sync_entry); @@ -849,7 +843,7 @@ void QSGRenderThread::syncAndRender(QImage *grabImage) int(threadTimer.elapsed()), int((syncTime/1000000)), int((renderTime - syncTime) / 1000000), - int(threadTimer.elapsed() - renderTime / 1000000)); + int((threadTimer.nsecsElapsed() - renderTime) / 1000000)); Q_TRACE(QSG_swap_exit); Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame, |