Remove the QGLContext from QSGCanvas
authorGunnar Sletta <gunnar.sletta@nokia.com>
Fri, 5 Aug 2011 08:35:10 +0000 (10:35 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Fri, 5 Aug 2011 08:49:01 +0000 (10:49 +0200)
Change-Id: I6ad95d05d9874704b038943f7887611315733c89
Reviewed-on: http://codereview.qt.nokia.com/2678
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/declarative/items/qsgcanvas.cpp
src/declarative/items/qsgcanvas_p.h

index 4257650..94d220b 100644 (file)
@@ -1884,16 +1884,12 @@ void QSGCanvasRenderThread::run()
     if (!guiContext) {
         guiContext = new QGuiGLContext();
         guiContext->create();
+        guiContext->makeCurrent(renderer);
 
-        glContext = QGLContext::fromGuiGLContext(guiContext);
-
-    }
-
-    guiContext->makeCurrent(renderer);
-
-    if (!d->context->isReady())
         d->initializeSceneGraph();
-
+    } else {
+        guiContext->makeCurrent(renderer);
+    }
     
     while (!shouldExit) {
         lock();
index bb2c0f8..e16d916 100644 (file)
@@ -186,7 +186,6 @@ public:
     QSGCanvasRenderThread()
         : mutex(QMutex::NonRecursive)
         , guiContext(0)
-        , glContext(0)
         , isGuiBlocked(0)
         , isPaintCompleted(false)
         , isGuiBlockPending(false)
@@ -231,7 +230,6 @@ public:
     QSGCanvasPrivate *d;
 
     QGuiGLContext *guiContext;
-    QGLContext *glContext;
 
     int isGuiBlocked;
     uint isPaintCompleted : 1;