summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-09 22:12:45 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-09 22:12:45 (GMT)
commitda6cf7f8956bc33b5a20c6e62f75a8de1a2d6af2 (patch)
tree29b1533eea5570cd25d606130cf54ca0c49a5514 /src
parent3aff620eda8d0c2ba2fe6e0d8fa61709cc86b5f4 (diff)
downloadQt-da6cf7f8956bc33b5a20c6e62f75a8de1a2d6af2.zip
Qt-da6cf7f8956bc33b5a20c6e62f75a8de1a2d6af2.tar.gz
Qt-da6cf7f8956bc33b5a20c6e62f75a8de1a2d6af2.tar.bz2
Document why an FBO of 0 needs to be bound in QGLPaintBuffer sometimes
Reviewed-by: trustme
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qglpaintdevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index 7dac55d..8863b01 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -70,6 +70,12 @@ void QGLPaintDevice::beginPaint()
// Record the currently bound FBO so we can restore it again
// in endPaint() and bind this device's FBO
+ //
+ // Note: m_thisFBO could be zero if the paint device is not
+ // backed by an FBO (e.g. window back buffer). But there could
+ // be a previous FBO bound to the context which we need to
+ // explicitly unbind. Otherwise the painting will go into
+ // the previous FBO instead of to the window.
m_previousFBO = ctx->d_func()->current_fbo;
if (m_previousFBO != m_thisFBO) {
ctx->d_ptr->current_fbo = m_thisFBO;