summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-11-15 22:04:46 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-11-15 22:13:09 (GMT)
commit0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3 (patch)
treeb5917c87769d657b16d6b726d59c4e3ae1839d96 /src/opengl
parentbb818bf70cef00bbdcafaac1bf017575baeab8dc (diff)
downloadQt-0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3.zip
Qt-0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3.tar.gz
Qt-0e74cc3e1a05147a8ae9c1c4be7c9f836da1acf3.tar.bz2
Make isSharing() reset to false when context no longer sharing
The documentation for QGLContext::isSharing() indicates that the function returns true only when the context is sharing. However, previously the sharing flag would stay on if the context was created as sharing but is no longer sharing. Task-number: QTBUG-5578 Reviewed-by: Sarah Smith
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp2
-rw-r--r--src/opengl/qgl_p.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 8063fc8..f8a2ea4 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -3030,7 +3030,7 @@ void QGLContext::setValid(bool valid)
bool QGLContext::isSharing() const
{
Q_D(const QGLContext);
- return d->sharing;
+ return d->group->isSharing();
}
QGLFormat QGLContext::format() const
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 9a17c67..45b2942 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -233,6 +233,7 @@ public:
QGLExtensionFuncs &extensionFuncs() {return m_extensionFuncs;}
const QGLContext *context() const {return m_context;}
+ bool isSharing() const { return m_shares.size() >= 2; }
void addGuard(QGLSharedResourceGuard *guard);
void removeGuard(QGLSharedResourceGuard *guard);