summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/testlite
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-09-02 13:27:27 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-09-02 13:27:27 (GMT)
commit4e630e3af2f33a123abb58f15f95d640d9054cd6 (patch)
treec2a45e34f0a8d6ae6539fb820bcc899a1d0849d7 /src/plugins/platforms/testlite
parent5e7fdcc7a4a2bb070ad7ece920ac5db81e3e6f77 (diff)
downloadQt-4e630e3af2f33a123abb58f15f95d640d9054cd6.zip
Qt-4e630e3af2f33a123abb58f15f95d640d9054cd6.tar.gz
Qt-4e630e3af2f33a123abb58f15f95d640d9054cd6.tar.bz2
Lighthouse: Move shared context init
so it is not created untill anyone asks for it.
Diffstat (limited to 'src/plugins/platforms/testlite')
-rw-r--r--src/plugins/platforms/testlite/qglxintegration.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/plugins/platforms/testlite/qglxintegration.cpp b/src/plugins/platforms/testlite/qglxintegration.cpp
index fbffcab..e262d5b 100644
--- a/src/plugins/platforms/testlite/qglxintegration.cpp
+++ b/src/plugins/platforms/testlite/qglxintegration.cpp
@@ -241,18 +241,18 @@ QGLXGLContext::QGLXGLContext(Window window, MyDisplay *xd, const QPlatformWindow
, m_drawable((Drawable)window)
, m_context(0)
{
- if (!QPlatformGLContext::defaultSharedContext()) {
- if (m_defaultSharedContextMutex.tryLock()){
- createDefaultSharedContex(xd);
- m_defaultSharedContextMutex.unlock();
- } else {
- m_defaultSharedContextMutex.lock(); //wait to the the shared context is created
- m_defaultSharedContextMutex.unlock();
- }
- }
QPlatformGLContext *sharePlatformContext;
if (format.useDefaultSharedContext()) {
+ if (!QPlatformGLContext::defaultSharedContext()) {
+ if (m_defaultSharedContextMutex.tryLock()){
+ createDefaultSharedContex(xd);
+ m_defaultSharedContextMutex.unlock();
+ } else {
+ m_defaultSharedContextMutex.lock(); //wait to the the shared context is created
+ m_defaultSharedContextMutex.unlock();
+ }
+ }
sharePlatformContext = QPlatformGLContext::defaultSharedContext();
} else {
sharePlatformContext = format.sharedGLContext();
@@ -309,9 +309,6 @@ void QGLXGLContext::createDefaultSharedContex(MyDisplay *xd)
} else {
qWarning("Warning no shared context created");
}
-
-
-
}
void QGLXGLContext::makeCurrent()