Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use qDebug for all debug under src/quick/scenegraph.
Mixing printf and qDebug can make the output come out of sync.

Change-Id: Ia71e71b09cb3bf651010eb2eb652db7899b07f0d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
  • Loading branch information
sletta authored and The Qt Project committed Jan 7, 2014
1 parent 156ce39 commit f03de54
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
Expand Up @@ -169,7 +169,7 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material)

#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
printf(" - compiling material: %dms\n", (int) qsg_renderer_timer.elapsed());
qDebug(" - compiling material: %dms", (int) qsg_renderer_timer.elapsed());

if (QQmlProfilerService::enabled) {
QQmlProfilerService::sceneGraphFrame(
Expand Down Expand Up @@ -208,7 +208,7 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate

#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
printf(" - compiling material: %dms\n", (int) qsg_renderer_timer.elapsed());
qDebug(" - compiling material: %dms", (int) qsg_renderer_timer.elapsed());

if (QQmlProfilerService::enabled) {
QQmlProfilerService::sceneGraphFrame(
Expand Down Expand Up @@ -2249,7 +2249,7 @@ void Renderer::preprocess()
void Renderer::render()
{
if (Q_UNLIKELY(debug_dump)) {
printf("\n\n");
qDebug("\n");
QSGNodeDumper::dump(rootNode());
}

Expand Down
2 changes: 1 addition & 1 deletion src/quick/scenegraph/coreapi/qsgrenderer.cpp
Expand Up @@ -279,7 +279,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)

#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - Breakdown of render time: preprocess=%d, updates=%d, binding=%d, render=%d, total=%d\n",
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),
Expand Down
2 changes: 1 addition & 1 deletion src/quick/scenegraph/qsgadaptationlayer.cpp
Expand Up @@ -189,7 +189,7 @@ void QSGDistanceFieldGlyphCache::update()

#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - glyphs: count=%d, render=%d, store=%d, total=%d\n",
qDebug(" - glyphs: count=%d, render=%d, store=%d, total=%d",
count,
int(renderTime/1000000),
(int) qsg_render_timer.elapsed() - int(renderTime/1000000),
Expand Down
3 changes: 2 additions & 1 deletion src/quick/scenegraph/qsgthreadedrenderloop.cpp
Expand Up @@ -1136,7 +1136,8 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w)

#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
qDebug(" - on GUI: polish=%d, lock=%d, block/sync=%d -- animations=%d",
qDebug(" - Gui Thread: window=%p, polish=%d, lock=%d, block/sync=%d -- animations=%d",
w->window,
int(polishTime/1000000),
int((waitTime - polishTime)/1000000),
int((syncTime - waitTime)/1000000),
Expand Down
2 changes: 1 addition & 1 deletion src/quick/scenegraph/qsgwindowsrenderloop.cpp
Expand Up @@ -61,7 +61,7 @@ extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_

#ifdef QSG_RENDER_LOOP_DEBUG
static QElapsedTimer qsg_debug_timer;
# define RLDEBUG(x) printf("(%6d) %s : %4d - %s\n", (int) qsg_debug_timer.elapsed(), __FILE__, __LINE__, x)
# define RLDEBUG(x) qDebug("(%6d) %s : %4d - %s", (int) qsg_debug_timer.elapsed(), __FILE__, __LINE__, x)
#else
# define RLDEBUG(x)
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/quick/scenegraph/util/qsgatlastexture.cpp
Expand Up @@ -375,7 +375,7 @@ bool Atlas::bind(QSGTexture::Filtering filtering)

#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - AtlasTexture(%dx%d), uploaded in %d ms\n",
qDebug(" - AtlasTexture(%dx%d), uploaded in %d ms",
m_pending_uploads.at(i)->image().width(),
m_pending_uploads.at(i)->image().height(),
(int) (qsg_renderer_timer.elapsed()));
Expand Down
4 changes: 2 additions & 2 deletions src/quick/scenegraph/util/qsgtexture.cpp
Expand Up @@ -629,7 +629,7 @@ void QSGPlainTexture::bind()
glDeleteTextures(1, &m_texture_id);
#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - texture deleted in %dms (size: %dx%d)\n",
qDebug(" - texture deleted in %dms (size: %dx%d)",
(int) qsg_renderer_timer.elapsed(),
m_texture_size.width(),
m_texture_size.height());
Expand Down Expand Up @@ -725,7 +725,7 @@ void QSGPlainTexture::bind()
if (qsg_render_timing) {
mipmapTime = qsg_renderer_timer.nsecsElapsed();

printf(" - plaintexture(%dx%d) bind=%d, convert=%d, swizzle=%d (%s->%s), upload=%d, mipmap=%d, total=%d\n",
qDebug(" - plaintexture(%dx%d) bind=%d, convert=%d, swizzle=%d (%s->%s), upload=%d, mipmap=%d, total=%d",
m_texture_size.width(), m_texture_size.height(),
int(bindTime/1000000),
int((convertTime - bindTime)/1000000),
Expand Down

0 comments on commit f03de54

Please sign in to comment.