summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-06-22 11:15:49 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-07-02 10:25:27 (GMT)
commit35f0729a36f1562abc4b3bb12e35d86afdd19a9d (patch)
tree5462b6e8a701e73a14ec3afd06ca53d8c014fa1b
parent7348a762379bbc615194281806949e7fbac503a1 (diff)
downloadQt-35f0729a36f1562abc4b3bb12e35d86afdd19a9d.zip
Qt-35f0729a36f1562abc4b3bb12e35d86afdd19a9d.tar.gz
Qt-35f0729a36f1562abc4b3bb12e35d86afdd19a9d.tar.bz2
Clean up debug output.
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp13
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp8
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h5
-rw-r--r--src/opengl/qgl.cpp20
4 files changed, 33 insertions, 13 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index c06bb3c..4b5f53e 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -46,6 +46,8 @@
#include <QMetaEnum>
#endif
+// #define QT_GL_SHARED_SHADER_DEBUG
+
QT_BEGIN_NAMESPACE
class QGLShaderStorage
@@ -53,10 +55,8 @@ class QGLShaderStorage
public:
QGLEngineSharedShaders *shadersForThread(const QGLContext *context) {
QGLContextGroupResource<QGLEngineSharedShaders> *&shaders = m_storage.localData();
- if (!shaders) {
- qDebug() << "New thread storage for:" << hex << QThread::currentThread();
+ if (!shaders)
shaders = new QGLContextGroupResource<QGLEngineSharedShaders>();
- }
return shaders->value(context);
}
@@ -229,11 +229,16 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
<< simpleShaderProg->log();
}
+#ifdef QT_GL_SHARED_SHADER_DEBUG
+ qDebug(" -> QGLEngineSharedShaders() %p for thread %p.", this, QThread::currentThread());
+#endif
}
QGLEngineSharedShaders::~QGLEngineSharedShaders()
{
- qDebug() << "####### ~QGLEngineSharedShaders() ##########";
+#ifdef QT_GL_SHARED_SHADER_DEBUG
+ qDebug(" -> ~QGLEngineSharedShaders() %p for thread %p.", this, QThread::currentThread());
+#endif
qDeleteAll(shaders);
shaders.clear();
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 001a09e..290c57e 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -66,12 +66,16 @@ QGLTextureGlyphCache::QGLTextureGlyphCache(const QGLContext *context, QFontEngin
if (!ctx->d_ptr->workaround_brokenFBOReadBack && pex != 0)
glGenFramebuffers(1, &m_fbo);
- fprintf(stderr, "## QGLTextureGlyphCache(): ctx: %p - this: %p\n", ctx, this);
+#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
+ qDebug(" -> QGLTextureGlyphCache() %p for context %p.", this, ctx);
+#endif
}
QGLTextureGlyphCache::~QGLTextureGlyphCache()
{
- fprintf(stderr, "## ~QGLTextureGlyphCache(): context: %p - this: %p\n", ctx, this);
+#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
+ qDebug(" -> ~QGLTextureGlyphCache() %p.", this);
+#endif
}
void QGLTextureGlyphCache::createTextureData(int width, int height)
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
index 1a78eed..04d1354 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h
@@ -57,6 +57,7 @@
#include <private/qgl_p.h>
#include <qglshaderprogram.h>
+// #define QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
QT_BEGIN_NAMESPACE
@@ -87,7 +88,9 @@ public:
}
void freeResource(void *) {
- qDebug() << "QGLTextureGlyphCache::freeResource():" << this << "ctx:" << ctx;
+#ifdef QT_GL_TEXTURE_GLYPH_CACHE_DEBUG
+ qDebug("Freeing glyph cache resource %p for context %p.", this, ctx);
+#endif
// At this point, the context group is made current, so it's safe to
// release resources without a makeCurrent() call
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 6755d93..19ab51d 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -94,6 +94,8 @@
#include <qmutex.h>
+// #define QT_GL_CONTEXT_RESOURCE_DEBUG
+
QT_BEGIN_NAMESPACE
#if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS)
@@ -2028,7 +2030,6 @@ QGLContext::~QGLContext()
// remove any textures cached in this context
QGLTextureCache::instance()->removeContextTextures(this);
- qDebug() << "~QGLContext(): about to clean up" << hex << this;
// clean up resources specific to this context
d_ptr->cleanup();
// clean up resources belonging to this context's group
@@ -5292,14 +5293,18 @@ void QGLContextGroup::removeShare(const QGLContext *context) {
QGLContextGroupResourceBase::QGLContextGroupResourceBase()
: active(0)
{
+#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
+ qDebug("Creating context group resource object %p.", this);
+#endif
}
QGLContextGroupResourceBase::~QGLContextGroupResourceBase()
{
- qDebug() << "~QGLContextGroupResourceBase()" << hex << this << "group size:" << m_groups.size();
+#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
+ qDebug("Deleting context group resource %p. Group size: %d.", this, m_groups.size());
+#endif
for (int i = 0; i < m_groups.size(); ++i) {
m_groups.at(i)->m_resources.remove(this);
- qDebug() << " ->removing from group resource list:" << hex << this;
active.deref();
}
#ifndef QT_NO_DEBUG
@@ -5313,6 +5318,9 @@ QGLContextGroupResourceBase::~QGLContextGroupResourceBase()
void QGLContextGroupResourceBase::insert(const QGLContext *context, void *value)
{
+#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
+ qDebug("Inserting context group resource %p for context %p, managed by %p.", value, context, this);
+#endif
QGLContextGroup *group = QGLContextPrivate::contextGroup(context);
Q_ASSERT(!group->m_resources.contains(this));
group->m_resources.insert(this, value);
@@ -5328,7 +5336,9 @@ void *QGLContextGroupResourceBase::value(const QGLContext *context)
void QGLContextGroupResourceBase::cleanup(const QGLContext *ctx, void *value)
{
- qDebug() << "QGLContextGroupResourceBase::cleanup() this:" << hex << this << "ctx:" << ctx << "thread:" << (void *)QThread::currentThread();
+#ifdef QT_GL_CONTEXT_RESOURCE_DEBUG
+ qDebug("Cleaning up context group resource %p, for context %p in thread %p.", this, ctx, QThread::currentThread());
+#endif
QGLShareContextScope scope(ctx);
freeResource(value);
active.deref();
@@ -5339,8 +5349,6 @@ void QGLContextGroupResourceBase::cleanup(const QGLContext *ctx, void *value)
void QGLContextGroup::cleanupResources(const QGLContext *context)
{
- qDebug() << "QGLContextGroup::cleanupResources() for ctx:" << hex << context
- << "shares:" << m_shares.size() << "res:" << m_resources.size();
// If there are still shares, then no cleanup to be done yet.
if (m_shares.size() > 1)
return;