From 219c2eb4e28dd1c806cbc2115ff40454d6d3f9c5 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Tue, 1 Jul 2014 18:38:32 +0200 Subject: [PATCH] Rename globalShareContext to qt_gl_global_share_context This makes it easier to forward-declare the exported symbol from other Qt modules without having to include the private headers. This keeps the old API until dependent submodules are updated. Change-Id: I08310a684b79f2f612f2ce897a601ff74178bee6 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qopenglcontext.cpp | 34 +++++++++++++++++++++---------- src/gui/kernel/qopenglcontext_p.h | 3 +++ src/widgets/kernel/qwidget.cpp | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index c7f4e6455c..8e848f90ae 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -242,6 +242,27 @@ QHash QOpenGLContextPrivate::makeCurrentTracker; QMutex QOpenGLContextPrivate::makeCurrentTrackerMutex; #endif +/*! + \internal + + This function is used by the Qt WebEngine to set up context sharing + across multiple windows. Do not use it for any other purpose. + + Please maintain the binary compatibility of these functions. +*/ +void qt_gl_set_global_share_context(QOpenGLContext *context) +{ + global_share_context = context; +} + +/*! + \internal +*/ +QOpenGLContext *qt_gl_global_share_context() +{ + return global_share_context; +} + /*! \class QOpenGLContext \inmodule QtGui @@ -336,23 +357,14 @@ QOpenGLContext *QOpenGLContextPrivate::setCurrentContext(QOpenGLContext *context return previous; } -/*! - \internal - - This function is used by the Qt WebEngine to set up context sharing - across multiple windows. Do not use it for any other purpose. -*/ void QOpenGLContextPrivate::setGlobalShareContext(QOpenGLContext *context) { - global_share_context = context; + qt_gl_set_global_share_context(context); } -/*! - \internal -*/ QOpenGLContext *QOpenGLContextPrivate::globalShareContext() { - return global_share_context; + return qt_gl_global_share_context(); } int QOpenGLContextPrivate::maxTextureSize() diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h index 77e3605a4b..4447df5294 100644 --- a/src/gui/kernel/qopenglcontext_p.h +++ b/src/gui/kernel/qopenglcontext_p.h @@ -275,6 +275,9 @@ public: #endif }; +Q_GUI_EXPORT void qt_gl_set_global_share_context(QOpenGLContext *context); +Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context(); + QT_END_NAMESPACE #endif // QT_NO_OPENGL diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 43ce9a82f7..05e638574d 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -11986,7 +11986,7 @@ QOpenGLContext *QWidgetPrivate::shareContext() const QWidgetPrivate *that = const_cast(this); if (!extra->topextra->shareContext) { QOpenGLContext *ctx = new QOpenGLContext; - ctx->setShareContext(QOpenGLContextPrivate::globalShareContext()); + ctx->setShareContext(qt_gl_global_share_context()); ctx->setFormat(extra->topextra->window->format()); ctx->create(); that->extra->topextra->shareContext = ctx;