diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-08-31 00:52:12 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-08-31 00:52:12 (GMT) |
commit | 46403d21e1cfd5b4b89244067a4111d5c2c0ff1a (patch) | |
tree | c520ad63b6614ed7c31aae83bdc1899762c95b2d /src/opengl/qpixmapdata_gl.cpp | |
parent | f270536c4e57bef2cbf203035f89feeb1a86c4df (diff) | |
download | Qt-46403d21e1cfd5b4b89244067a4111d5c2c0ff1a.zip Qt-46403d21e1cfd5b4b89244067a4111d5c2c0ff1a.tar.gz Qt-46403d21e1cfd5b4b89244067a4111d5c2c0ff1a.tar.bz2 |
Move QGLShareContextScope to qgl_p.h so other things can use it.
Reviewed-by: trustme
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index c193f12..e18f98b 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -132,43 +132,6 @@ void QGLFramebufferObjectPool::release(QGLFramebufferObject *fbo) m_fbos << fbo; } -class QGLShareContextScope -{ -public: - QGLShareContextScope(const QGLContext *ctx) - : m_oldContext(0) - { - QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext()); - if (currentContext != ctx && !qgl_share_reg()->checkSharing(ctx, currentContext)) { - m_oldContext = currentContext; - m_ctx = const_cast<QGLContext *>(ctx); - m_ctx->makeCurrent(); - } else { - m_ctx = currentContext; - } - } - - operator QGLContext *() - { - return m_ctx; - } - - QGLContext *operator->() - { - return m_ctx; - } - - ~QGLShareContextScope() - { - if (m_oldContext) - m_oldContext->makeCurrent(); - } - -private: - QGLContext *m_oldContext; - QGLContext *m_ctx; -}; - static int qt_gl_pixmap_serial = 0; QGLPixmapData::QGLPixmapData(PixelType type) |