eglfs: keep context active only during flush
authorGirish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Sun, 27 May 2012 05:34:29 +0000 (22:34 -0700)
committerQt by Nokia <qt-info@nokia.com>
Wed, 30 May 2012 09:10:42 +0000 (11:10 +0200)
The OpenGL context needs to be current only while flushing
the backing store.

Change-Id: I4d6a10f22bcfe04f35a14a690180237f6c691829
Reviewed-by: Andy Nichols <andy.nichols@nokia.com>
src/plugins/platforms/eglfs/qeglfsbackingstore.cpp

index a3b3277..539e4be 100644 (file)
@@ -76,6 +76,8 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
     Q_UNUSED(region);
     Q_UNUSED(offset);
 
+    makeCurrent();
+
 #ifdef QEGL_EXTRA_DEBUG
     qWarning("QEglBackingStore::flush %p", window);
 #endif
@@ -183,6 +185,8 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
         cursor->render();
 
     m_context->swapBuffers(window);
+
+    m_context->doneCurrent();
 }
 
 void QEglFSBackingStore::makeCurrent()
@@ -195,8 +199,6 @@ void QEglFSBackingStore::makeCurrent()
 
 void QEglFSBackingStore::beginPaint(const QRegion &rgn)
 {
-    makeCurrent();
-
     m_dirty = m_dirty | rgn;
 }