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/qsgadaptationlayer.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/qsgadaptationlayer.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgadaptationlayer.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index 17f4ba1243..0ac5f237e0 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -44,6 +44,7 @@ #include <qmath.h> #include <QtQuick/private/qsgdistancefieldutil_p.h> #include <QtQuick/private/qsgdistancefieldglyphnode_p.h> +#include <QtQuick/private/qsgcontext_p.h> #include <private/qrawfont_p.h> #include <QtGui/qguiapplication.h> #include <qdir.h> @@ -53,10 +54,7 @@ QT_BEGIN_NAMESPACE -#ifndef QSG_NO_RENDER_TIMING -static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty(); static QElapsedTimer qsg_render_timer; -#endif QSGDistanceFieldGlyphCache::Texture QSGDistanceFieldGlyphCache::s_emptyTexture; @@ -163,11 +161,9 @@ void QSGDistanceFieldGlyphCache::update() if (m_pendingGlyphs.isEmpty()) return; -#ifndef QSG_NO_RENDER_TIMING - bool profileFrames = qsg_render_timing || QQuickProfiler::enabled; + bool profileFrames = QSG_LOG_TIME_GLYPH().isDebugEnabled() || QQuickProfiler::enabled; if (profileFrames) qsg_render_timer.start(); -#endif QList<QDistanceField> distanceFields; for (int i = 0; i < m_pendingGlyphs.size(); ++i) { @@ -176,31 +172,28 @@ void QSGDistanceFieldGlyphCache::update() m_doubleGlyphResolution)); } -#ifndef QSG_NO_RENDER_TIMING qint64 renderTime = 0; int count = m_pendingGlyphs.size(); if (profileFrames) renderTime = qsg_render_timer.nsecsElapsed(); -#endif m_pendingGlyphs.reset(); storeGlyphs(distanceFields); -#ifndef QSG_NO_RENDER_TIMING - if (qsg_render_timing) { - qDebug(" - glyphs: count=%d, render=%d, store=%d, total=%d", - count, - int(renderTime/1000000), - (int) qsg_render_timer.elapsed() - int(renderTime/1000000), - (int) qsg_render_timer.elapsed()); - + if (QSG_LOG_TIME_GLYPH().isDebugEnabled()) { + quint64 now = qsg_render_timer.elapsed(); + qCDebug(QSG_LOG_TIME_GLYPH, + "distancefield: %d glyphs prepared in %dms, rendering=%d, upload=%d", + count, + (int) now, + int(renderTime / 1000000), + int((now - (renderTime / 1000000)))); } Q_QUICK_SG_PROFILE1(QQuickProfiler::SceneGraphAdaptationLayerFrame, ( count, renderTime, qsg_render_timer.nsecsElapsed() - renderTime)); -#endif } void QSGDistanceFieldGlyphCache::setGlyphsPosition(const QList<GlyphPosition> &glyphs) |