QOpenGLContext context;
context.setFormat(requestedFormat());
- context.setShareContext(QSGContext::sharedOpenGLContext());
+ context.setShareContext(QOpenGLContextPrivate::globalShareContext());
context.create();
context.makeCurrent(this);
d->context->initialize(&context);
bool distanceFieldDisabled;
QSGDistanceFieldGlyphNode::AntialiasingMode distanceFieldAntialiasing;
bool distanceFieldAntialiasingDecided;
-
- static QOpenGLContext *sharedOpenGLContext;
};
-QOpenGLContext *QSGContextPrivate::sharedOpenGLContext = 0;
-
class QSGTextureCleanupEvent : public QEvent
{
public:
return new QSGRenderContext(this);
}
-/*!
- * 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 QSGContext::setSharedOpenGLContext(QOpenGLContext *context)
-{
- QSGContextPrivate::sharedOpenGLContext = context;
-}
-
-QOpenGLContext *QSGContext::sharedOpenGLContext()
-{
- return QSGContextPrivate::sharedOpenGLContext;
-}
-
void QSGContext::renderContextInitialized(QSGRenderContext *renderContext)
{
Q_D(QSGContext);
virtual QSize minimumFBOSize() const;
virtual QSurfaceFormat defaultSurfaceFormat() const;
- static void setSharedOpenGLContext(QOpenGLContext *context);
- static QOpenGLContext *sharedOpenGLContext();
-
void setDistanceFieldEnabled(bool enabled);
bool isDistanceFieldEnabled() const;
if (!gl) {
gl = new QOpenGLContext();
gl->setFormat(window->requestedFormat());
- if (QSGContext::sharedOpenGLContext())
- gl->setShareContext(QSGContext::sharedOpenGLContext());
+ if (QOpenGLContextPrivate::globalShareContext())
+ gl->setShareContext(QOpenGLContextPrivate::globalShareContext());
if (!gl->create()) {
const bool isEs = gl->isES();
delete gl;
if (!w->thread->gl) {
w->thread->gl = new QOpenGLContext();
- if (QSGContext::sharedOpenGLContext())
- w->thread->gl->setShareContext(QSGContext::sharedOpenGLContext());
+ if (QOpenGLContextPrivate::globalShareContext())
+ w->thread->gl->setShareContext(QOpenGLContextPrivate::globalShareContext());
w->thread->gl->setFormat(w->window->requestedFormat());
if (!w->thread->gl->create()) {
const bool isEs = w->thread->gl->isES();
RLDEBUG(" - creating GL context");
m_gl = new QOpenGLContext();
m_gl->setFormat(window->requestedFormat());
- if (QSGContext::sharedOpenGLContext())
- m_gl->setShareContext(QSGContext::sharedOpenGLContext());
+ if (QOpenGLContextPrivate::globalShareContext())
+ m_gl->setShareContext(QOpenGLContextPrivate::globalShareContext());
bool created = m_gl->create();
if (!created) {
const bool isEs = m_gl->isES();
context = new QOpenGLContext;
context->setFormat(offscreenWindow->requestedFormat());
- if (QSGContext::sharedOpenGLContext())
- context->setShareContext(QSGContext::sharedOpenGLContext()); // ??? is this correct
+ if (QOpenGLContextPrivate::globalShareContext())
+ context->setShareContext(QOpenGLContextPrivate::globalShareContext());
if (!context->create()) {
const bool isEs = context->isES();
delete context;
#include <QtQuick/qquickview.h>
#include <private/qabstractanimation_p.h>
-#include <private/qsgcontext_p.h>
+#include <private/qopenglcontext_p.h>
#ifdef QT_WIDGETS_LIB
#include <QtWidgets/QApplication>
if (options.contextSharing) {
shareContext.reset(new QOpenGLContext);
shareContext->create();
- QSGContext::setSharedOpenGLContext(shareContext.data());
+ QOpenGLContextPrivate::setGlobalShareContext(shareContext.data());
}
int exitCode = 0;