From 7b6d200503e036603a252ef8de72110f5afcf11d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 10 May 2017 10:48:14 +0200 Subject: Add debug operator for QOpenGLTexture Change-Id: If87730725d9eba8d4c1e0158056cdeaa7c1bc12f Reviewed-by: Shawn Rutledge --- src/gui/opengl/qopengltexture.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/gui/opengl/qopengltexture.cpp') diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 4d0ba212ab1..3563f1b5d36 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -43,6 +43,7 @@ #include "qopenglfunctions.h" #include #include +#include #include #include @@ -4670,4 +4671,40 @@ float QOpenGLTexture::levelofDetailBias() const return d->levelOfDetailBias; } +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug debug, const QOpenGLTexture *t) +{ + QDebugStateSaver saver(debug); + debug.nospace(); + debug << "QOpenGLTexture("; + if (t) { + const QOpenGLTexturePrivate *d = t->d_ptr.data(); + debug << d->target << ", bindingTarget=" << d->bindingTarget + << ", size=[" << d->dimensions[0] + << ", " << d->dimensions[1]; + if (d->target == QOpenGLTexture::Target3D) + debug << ", " << d->dimensions[2]; + debug << "], format=" << d->format << ", formatClass=" << d->formatClass; + if (t->isCreated()) + debug << ", textureId=" << d->textureId; + if (t->isBound()) + debug << ", [bound]"; + if (t->isTextureView()) + debug << ", [view]"; + if (d->fixedSamplePositions) + debug << ", [fixedSamplePositions]"; + debug << ", mipLevels=" << d->requestedMipLevels << ", layers=" << d->layers + << ", faces=" << d->faces << ", samples=" << d->samples + << ", depthStencilMode=" << d->depthStencilMode << ", comparisonFunction=" + << d->comparisonFunction << ", comparisonMode=" << d->comparisonMode + << ", features=" << d->features << ", minificationFilter=" << d->minFilter + << ", magnificationFilter=" << d->magFilter << ", wrapMode=" << d->wrapModes[0]; + } else { + debug << '0'; + } + debug << ')'; + return debug; +} +#endif // QT_NO_DEBUG_STREAM + QT_END_NAMESPACE -- cgit v1.2.3