diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-09-01 12:09:29 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-09-01 12:26:14 (GMT) |
commit | ae2f5c66d16fab9f92f960435057d955e9a832ef (patch) | |
tree | c76615e7f9a9292d0d129de3b532c9fac39ab653 /src | |
parent | d0b4bd21d5fc04febdfdb41111435d79750e5ff6 (diff) | |
download | Qt-ae2f5c66d16fab9f92f960435057d955e9a832ef.zip Qt-ae2f5c66d16fab9f92f960435057d955e9a832ef.tar.gz Qt-ae2f5c66d16fab9f92f960435057d955e9a832ef.tar.bz2 |
Fixed QGLFramebufferObject::toImage() releasing the FBO if bound.
Reviewed-by: Trond
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/qglframebufferobject.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 9659654..859afc7 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -875,9 +875,12 @@ QImage QGLFramebufferObject::toImage() const if (!d->valid) return QImage(); - const_cast<QGLFramebufferObject *>(this)->bind(); + bool wasBound = isBound(); + if (!wasBound) + const_cast<QGLFramebufferObject *>(this)->bind(); QImage image = qt_gl_read_framebuffer(d->size, d->ctx->format().alpha(), true); - const_cast<QGLFramebufferObject *>(this)->release(); + if (!wasBound) + const_cast<QGLFramebufferObject *>(this)->release(); return image; } |