summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglframebufferobject.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-17 08:25:03 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-06-17 08:56:33 (GMT)
commit4cacc45d10e59bb8915b8d76c359df7a8ad0a846 (patch)
tree1cc67f1bce59e9c85b9670831ab9d2acbf4b1269 /src/opengl/qglframebufferobject.cpp
parent583a306bb66601d4aa1ecc0429cc9e02aa6f9246 (diff)
downloadQt-4cacc45d10e59bb8915b8d76c359df7a8ad0a846.zip
Qt-4cacc45d10e59bb8915b8d76c359df7a8ad0a846.tar.gz
Qt-4cacc45d10e59bb8915b8d76c359df7a8ad0a846.tar.bz2
Prevented infinite recursion in GL graphics system.
If creating a QGLWidget triggers the creation of a QPixmap then we might end up in an infinite recursion due to QPixmap trying to access qt_gl_share_widget(). This can happen via setWindowIcon for example. Adding an initializing flag to QGLGlobalShareWidget and preventing QGLFramebufferObject::hasOpenGLFramebufferObjects() and ::hasOpenGLFramebufferBlit() from creating a QGLWidget every time they are called with no active GL context. Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qglframebufferobject.cpp')
-rw-r--r--src/opengl/qglframebufferobject.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 7f229e2..eacf5bb 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -935,8 +935,7 @@ QPaintEngine *QGLFramebufferObject::paintEngine() const
*/
bool QGLFramebufferObject::hasOpenGLFramebufferObjects()
{
- if (!QGLContext::currentContext())
- QGLWidget dmy; // needed to detect and init the QGLExtensions object
+ QGLExtensions::init();
return (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject);
}
@@ -1098,8 +1097,7 @@ bool QGLFramebufferObject::isBound() const
*/
bool QGLFramebufferObject::hasOpenGLFramebufferBlit()
{
- if (!QGLContext::currentContext())
- QGLWidget dmy; // needed to detect and init the QGLExtensions object
+ QGLExtensions::init();
return (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit);
}