From ead09e6b1fbfceacb68ee0e2e721c723300b0df6 Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Date: Tue, 1 Jul 2014 19:20:25 +0200
Subject: [PATCH] Use the renamed qt_gl_global_share_context

Change-Id: I438c33a1dc83fd0cd1ec08bb4e4a1257a3216ca2
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
---
 src/quick/items/qquickwindow.cpp               | 2 +-
 src/quick/scenegraph/qsgrenderloop.cpp         | 4 ++--
 src/quick/scenegraph/qsgthreadedrenderloop.cpp | 4 ++--
 src/quick/scenegraph/qsgwindowsrenderloop.cpp  | 4 ++--
 src/quickwidgets/qquickwidget.cpp              | 4 ++--
 tools/qmlscene/main.cpp                        | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index f1d2f63756..04539800a5 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -3132,7 +3132,7 @@ QImage QQuickWindow::grabWindow()
 
         QOpenGLContext context;
         context.setFormat(requestedFormat());
-        context.setShareContext(QOpenGLContextPrivate::globalShareContext());
+        context.setShareContext(qt_gl_global_share_context());
         context.create();
         context.makeCurrent(this);
         d->context->initialize(&context);
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 73b64b4f9b..064d363412 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -334,8 +334,8 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
     if (!gl) {
         gl = new QOpenGLContext();
         gl->setFormat(window->requestedFormat());
-        if (QOpenGLContextPrivate::globalShareContext())
-            gl->setShareContext(QOpenGLContextPrivate::globalShareContext());
+        if (qt_gl_global_share_context())
+            gl->setShareContext(qt_gl_global_share_context());
         if (!gl->create()) {
             const bool isEs = gl->isOpenGLES();
             delete gl;
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 793a247427..84ae3f818b 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -889,8 +889,8 @@ void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window)
 
         if (!w->thread->gl) {
             w->thread->gl = new QOpenGLContext();
-            if (QOpenGLContextPrivate::globalShareContext())
-                w->thread->gl->setShareContext(QOpenGLContextPrivate::globalShareContext());
+            if (qt_gl_global_share_context())
+                w->thread->gl->setShareContext(qt_gl_global_share_context());
             w->thread->gl->setFormat(w->window->requestedFormat());
             if (!w->thread->gl->create()) {
                 const bool isEs = w->thread->gl->isOpenGLES();
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 70f80689f5..671b341046 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -162,8 +162,8 @@ void QSGWindowsRenderLoop::show(QQuickWindow *window)
         RLDEBUG(" - creating GL context");
         m_gl = new QOpenGLContext();
         m_gl->setFormat(window->requestedFormat());
-        if (QOpenGLContextPrivate::globalShareContext())
-            m_gl->setShareContext(QOpenGLContextPrivate::globalShareContext());
+        if (qt_gl_global_share_context())
+            m_gl->setShareContext(qt_gl_global_share_context());
         bool created = m_gl->create();
         if (!created) {
             const bool isEs = m_gl->isOpenGLES();
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 91f4ac4bb7..fed39b18a5 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -631,8 +631,8 @@ void QQuickWidgetPrivate::createContext()
     context = new QOpenGLContext;
     context->setFormat(offscreenWindow->requestedFormat());
 
-    if (QOpenGLContextPrivate::globalShareContext())
-        context->setShareContext(QOpenGLContextPrivate::globalShareContext());
+    if (qt_gl_global_share_context())
+        context->setShareContext(qt_gl_global_share_context());
     if (!context->create()) {
         const bool isEs = context->isOpenGLES();
         delete context;
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index b048337cad..908b198e2d 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -460,7 +460,7 @@ int main(int argc, char ** argv)
     if (options.contextSharing) {
         shareContext.reset(new QOpenGLContext);
         shareContext->create();
-        QOpenGLContextPrivate::setGlobalShareContext(shareContext.data());
+        qt_gl_set_global_share_context(shareContext.data());
     }
 
     int exitCode = 0;
-- 
GitLab