From f9a00808991b01f5c3b473e9ec5d309b25b230b9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Sat, 22 Nov 2014 20:47:07 +0100 Subject: Default to threaded when using opengl32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This appplies only when using opengl32.dll. When using ANGLE or when using another non-opengl32 DLL, the "windows" single-threaded loop is chosen, just like before. One badly written autotest is fixed. We must never assume that performing some QQuickWindow related work will leave a context current on the main thread. The assumption worked by accident with the single-threaded render loop. [ChangeLog][QtQuick] Changed to use the threaded render loop by default on Windows when running with desktop OpenGL (opengl32.dll). Change-Id: I21798622c19ca510a97a96c19c1e70e29f086e3a Reviewed-by: Friedemann Kleint Reviewed-by: Jørgen Lind --- src/quick/scenegraph/qsgrenderloop.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/quick/scenegraph/qsgrenderloop.cpp') diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index ecfbe0323c..985be8591f 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -169,7 +169,12 @@ QSGRenderLoop *QSGRenderLoop::instance() RenderLoopType loopType = BasicRenderLoop; #ifdef Q_OS_WIN - loopType = WindowsRenderLoop; + // With desktop OpenGL (opengl32.dll), use threaded. Otherwise (ANGLE) use windows. + if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL + && QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) + loopType = ThreadedRenderLoop; + else + loopType = WindowsRenderLoop; #else if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)) loopType = ThreadedRenderLoop; -- cgit v1.2.3