diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-11-08 13:32:07 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-08 16:59:50 +0100 |
commit | 15b5ed3294dc03e51f84a9d0163283f35e570944 (patch) | |
tree | b5f2910fbdfcafb479c6aebcffc170510bdc18a8 /src/gui/kernel | |
parent | 96e3b44cdccdd42920fc2caf8749688919583d9d (diff) |
Relax QOpenGLContext::swapBuffers() conditions.
There's no need to force the context to be current and the correct FBO
to be bound when swapBuffers() is called, as this can easily be handled
on a per-platform basis.
Change-Id: I7af5a082d6a2b03dfa2cdc874c27617139a781a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 6c006ab8b3..e8aa44def7 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -561,11 +561,6 @@ QSurface *QOpenGLContext::surface() const Call this to finish a frame of OpenGL rendering, and make sure to call makeCurrent() again before you begin a new frame. - - If you have bound a non-default framebuffer object, you need to - use bindDefaultFramebufferObject() to make sure that the default - framebuffer object is bound before calling swapBuffers(), as - some Qt platforms assume that the default framebuffer object is bound. */ void QOpenGLContext::swapBuffers(QSurface *surface) { @@ -594,17 +589,8 @@ void QOpenGLContext::swapBuffers(QSurface *surface) return; #if !defined(QT_NO_DEBUG) - if (currentContext() != this) - qWarning() << "QOpenGLContext::swapBuffers() called with non-current surface"; - else if (!QOpenGLContextPrivate::toggleMakeCurrentTracker(this, false)) + if (!QOpenGLContextPrivate::toggleMakeCurrentTracker(this, false)) qWarning() << "QOpenGLContext::swapBuffers() called without corresponding makeCurrent()"; - - GLint framebufferBinding = 0; - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &framebufferBinding); - - GLint platformFramebuffer = GLint(d->platformGLContext->defaultFramebufferObject(surfaceHandle)); - if (framebufferBinding != platformFramebuffer) - qWarning() << "QOpenGLContext::swapBuffers() called with non-default framebuffer object bound"; #endif if (surface->format().swapBehavior() == QSurfaceFormat::SingleBuffer) glFlush(); |