diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-08-17 09:08:04 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-08-17 09:08:06 +0200 |
commit | 8842d9d1e6c0286922bf18357ca30c146d692316 (patch) | |
tree | 93b78c4f8dcb21275517f94da2ccc4500005e8c2 /src/gui/opengl | |
parent | 67352c92761fcb2e2c6a98b24e1bf5f33805cb3a (diff) | |
parent | 29778037f8a7b2c86bc4044409b37d5a51a15432 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8bb8227f9da982e7d5ebe5324fc27abd9ac0d4fc
Diffstat (limited to 'src/gui/opengl')
-rw-r--r-- | src/gui/opengl/qopenglframebufferobject.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 400888cc21..6486a447ee 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -55,12 +55,16 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_DEBUG #define QT_RESET_GLERROR() \ { \ - while (QOpenGLContext::currentContext()->functions()->glGetError() != GL_NO_ERROR) {} \ + while (true) {\ + GLenum error = QOpenGLContext::currentContext()->functions()->glGetError(); \ + if (error == GL_NO_ERROR || error == GL_CONTEXT_LOST) \ + break; \ + } \ } #define QT_CHECK_GLERROR() \ { \ GLenum err = QOpenGLContext::currentContext()->functions()->glGetError(); \ - if (err != GL_NO_ERROR) { \ + if (err != GL_NO_ERROR && err != GL_CONTEXT_LOST) { \ qDebug("[%s line %d] OpenGL Error: %d", \ __FILE__, __LINE__, (int)err); \ } \ @@ -134,6 +138,10 @@ QT_BEGIN_NAMESPACE #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #endif +#ifndef GL_CONTEXT_LOST +#define GL_CONTEXT_LOST 0x0507 +#endif + /*! @@ -1327,8 +1335,11 @@ static QImage qt_gl_read_framebuffer(const QSize &size, GLenum internal_format, { QOpenGLContext *ctx = QOpenGLContext::currentContext(); QOpenGLFunctions *funcs = ctx->functions(); - while (funcs->glGetError()); - + while (true) { + GLenum error = funcs->glGetError(); + if (error == GL_NO_ERROR || error == GL_CONTEXT_LOST) + break; + } switch (internal_format) { case GL_RGB: case GL_RGB8: |