diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-06-26 20:48:47 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-07-01 14:18:41 +0200 |
commit | 7a8cc93a0546bc38c54343d640e63062c3b398b2 (patch) | |
tree | db79fc70c17374ab44adbabc5b0b641ab08a96eb /src/quick/scenegraph/coreapi/qsgrenderer.cpp | |
parent | c67af3861f8ecec0eb16808d6d4984eef89db5d1 (diff) |
Use categorized logging for all things scenegraph.
Change-Id: I865ee838b0fd6c257b7189f24130012b98206fd1
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgrenderer.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrenderer.cpp | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp index 4a26eae6cd..d64bd4e14a 100644 --- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp +++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp @@ -63,12 +63,9 @@ QT_BEGIN_NAMESPACE static bool qsg_sanity_check = qgetenv("QSG_SANITY_CHECK").toInt(); -#ifndef QSG_NO_RENDER_TIMING -static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty(); static QElapsedTimer frameTimer; static qint64 preprocessTime; static qint64 updatePassTime; -#endif void QSGBindable::clear(QSGRenderer::ClearMode mode) const { @@ -226,22 +223,18 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) m_is_rendering = true; -#ifndef QSG_NO_RENDER_TIMING - bool profileFrames = qsg_render_timing || QQuickProfiler::enabled; + bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled() || QQuickProfiler::enabled; if (profileFrames) frameTimer.start(); qint64 bindTime = 0; qint64 renderTime = 0; -#endif m_bindable = &bindable; preprocess(); bindable.bind(); -#ifndef QSG_NO_RENDER_TIMING if (profileFrames) bindTime = frameTimer.nsecsElapsed(); -#endif // Sanity check that attribute registers are disabled if (qsg_sanity_check) { @@ -257,10 +250,8 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) } render(); -#ifndef QSG_NO_RENDER_TIMING if (profileFrames) renderTime = frameTimer.nsecsElapsed(); -#endif glDisable(GL_SCISSOR_TEST); m_is_rendering = false; @@ -277,15 +268,13 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) m_index_buffer_bound = false; } -#ifndef QSG_NO_RENDER_TIMING - if (qsg_render_timing) { - qDebug(" - Breakdown of render time: preprocess=%d, updates=%d, binding=%d, render=%d, total=%d", - int(preprocessTime / 1000000), - int((updatePassTime - preprocessTime) / 1000000), - int((bindTime - updatePassTime) / 1000000), - int((renderTime - bindTime) / 1000000), - int(renderTime / 1000000)); - } + qCDebug(QSG_LOG_TIME_RENDERER, + "time in renderer: total=%dms, preprocess=%d, updates=%d, binding=%d, rendering=%d", + int(renderTime / 1000000), + int(preprocessTime / 1000000), + int((updatePassTime - preprocessTime) / 1000000), + int((bindTime - updatePassTime) / 1000000), + int((renderTime - bindTime) / 1000000)); Q_QUICK_SG_PROFILE1(QQuickProfiler::SceneGraphRendererFrame, ( preprocessTime, @@ -293,7 +282,6 @@ void QSGRenderer::renderScene(const QSGBindable &bindable) bindTime - updatePassTime, renderTime - bindTime)); -#endif } void QSGRenderer::setProjectionMatrixToDeviceRect() @@ -374,19 +362,14 @@ void QSGRenderer::preprocess() } } -#ifndef QSG_NO_RENDER_TIMING - bool profileFrames = qsg_render_timing || QQuickProfiler::enabled; + bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled()|| QQuickProfiler::enabled; if (profileFrames) preprocessTime = frameTimer.nsecsElapsed(); -#endif nodeUpdater()->updateStates(m_root_node); -#ifndef QSG_NO_RENDER_TIMING if (profileFrames) updatePassTime = frameTimer.nsecsElapsed(); -#endif - } void QSGRenderer::addNodesToPreprocess(QSGNode *node) |