aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp7
-rw-r--r--tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp12
2 files changed, 17 insertions, 2 deletions
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;
diff --git a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
index ed97123644..535a875be0 100644
--- a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
+++ b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
@@ -36,6 +36,9 @@
#include <private/qabstractanimation_p.h>
#include <private/qquickanimatedsprite_p.h>
#include <QtGui/qpainter.h>
+#include <QtGui/qopenglcontext.h>
+#include <QtGui/qopenglfunctions.h>
+#include <QtGui/qoffscreensurface.h>
class tst_qquickanimatedsprite : public QQmlDataTest
{
@@ -251,7 +254,14 @@ void tst_qquickanimatedsprite::test_largeAnimation()
prevFrame = frame;
}
int maxTextureSize;
- ::glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
+ QOpenGLContext ctx;
+ ctx.create();
+ QOffscreenSurface offscreenSurface;
+ offscreenSurface.setFormat(ctx.format());
+ offscreenSurface.create();
+ QVERIFY(ctx.makeCurrent(&offscreenSurface));
+ ctx.functions()->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
+ ctx.doneCurrent();
maxTextureSize /= 512;
QVERIFY(maxFrame > maxTextureSize); // make sure we go beyond the texture width limitation
QCOMPARE(loopCounter, sprite->loops());