summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-05-11 13:49:01 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-05-11 19:34:46 +0000
commit6a8a93a2a19dd4eaf649b6384be8986c201406f5 (patch)
tree66ec8efbcffeeb6aa6e5de8e1ff28b8a4df01a6a /src/gui/opengl
parent9eb00a3397627a36a46e7bca52444996d4e7b0c9 (diff)
QOpenGLTexturePrivate::destroy(): Make error messages more verbose
Distinguish missing and non-sharing contexts, output values. Change-Id: If52555098c1b46e6016e00f9dbbfad8e4b5d3a2d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopengltexture.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index 766d4a327a..4d0ba212ab 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -190,11 +190,20 @@ void QOpenGLTexturePrivate::destroy()
return;
}
QOpenGLContext *currentContext = QOpenGLContext::currentContext();
- if (!currentContext || !QOpenGLContext::areSharing(currentContext, context)) {
- qWarning("Texture is not valid in the current context.\n"
+ if (!currentContext) {
+ qWarning("QOpenGLTexturePrivate::destroy() called without a current context.\n"
"Texture has not been destroyed");
return;
}
+ if (!QOpenGLContext::areSharing(currentContext, context)) {
+
+ qWarning("QOpenGLTexturePrivate::destroy() called but texture context %p"
+ " is not shared with current context %p.\n"
+ "Texture has not been destroyed",
+ static_cast<const void *>(context),
+ static_cast<const void *>(currentContext));
+ return;
+ }
functions->glDeleteTextures(1, &textureId);