Commit f03de549 by sletta Committed by The Qt Project

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: 's avatarRobin Burchell <robin+qt@viroteck.net>
parent 156ce398
......@@ -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(
......@@ -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(
......@@ -2249,7 +2249,7 @@ void Renderer::preprocess()
void Renderer::render()
{
if (Q_UNLIKELY(debug_dump)) {
printf("\n\n");
qDebug("\n");
QSGNodeDumper::dump(rootNode());
}
......
......@@ -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),
......
......@@ -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),
......
......@@ -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),
......
......@@ -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
......
......@@ -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()));
......
......@@ -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());
......@@ -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),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment