summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-09-09 06:23:54 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-09-09 06:23:54 (GMT)
commit6eb6920d134ee6a0cc0f27d63d65003a3d9c1fee (patch)
treee4abaa818134c282dc37e62a241d9b7b89b5fb0b /src/opengl/qgl.h
parent39bcbc8df52eb5df5f7e39dc4265c8a77d3881be (diff)
downloadQt-6eb6920d134ee6a0cc0f27d63d65003a3d9c1fee.zip
Qt-6eb6920d134ee6a0cc0f27d63d65003a3d9c1fee.tar.gz
Qt-6eb6920d134ee6a0cc0f27d63d65003a3d9c1fee.tar.bz2
Clean up shader programs properly
QGLShader and QGLShaderProgram used to delete the GL object id in the wrong context. But fixing this means we must keep track of when contexts are destroyed so that we don't try to access a context from a shader if it goes away. We also need to transfer ownership from one context to another when they are shared. This change introduces QGLSharedResourceGuard, which keeps track of a context and a GL object identifier. When the context goes away, ownership is passed to a shared context. When there are no more shared contexts, the identifier automatically zeroes. Reviewed-by: trustme
Diffstat (limited to 'src/opengl/qgl.h')
-rw-r--r--src/opengl/qgl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index 151c7c4..eba027f 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -396,6 +396,7 @@ private:
friend class QGLPixmapFilterBase;
friend class QGLTextureGlyphCache;
friend class QGLShareRegister;
+ friend class QGLSharedResourceGuard;
friend QGLFormat::OpenGLVersionFlags QGLFormat::openGLVersionFlags();
#ifdef Q_WS_MAC
public: