summaryrefslogtreecommitdiffstats
path: root/src/opengl/qwindowsurface_gl.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-24 13:02:23 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-09-24 13:03:57 (GMT)
commit836bbfced3e8c76cc0ac7458a54c7a2982ebea1c (patch)
treea6cd9094f0f65f86d470993606911efe3b9125f7 /src/opengl/qwindowsurface_gl.cpp
parent512d332d21860b1d08e86d6de96b80ce12d742bf (diff)
downloadQt-836bbfced3e8c76cc0ac7458a54c7a2982ebea1c.zip
Qt-836bbfced3e8c76cc0ac7458a54c7a2982ebea1c.tar.gz
Qt-836bbfced3e8c76cc0ac7458a54c7a2982ebea1c.tar.bz2
Prevented crash in svgviewer in graphics system OpenGL with QGLWidget.
Need to make sure the correct context is current when painting on the window surface FBO. Reviewed-by: Kim
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index e34b637..cddc53f 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -378,6 +378,8 @@ QPaintDevice *QGLWindowSurface::paintDevice()
if (d_ptr->ctx)
return &d_ptr->glDevice;
+ QGLContext *ctx = reinterpret_cast<QGLContext *>(window()->d_func()->extraData()->glContext);
+ ctx->makeCurrent();
return d_ptr->fbo;
}