summaryrefslogtreecommitdiffstats
path: root/tests/auto/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/opengl')
-rw-r--r--tests/auto/opengl/qgl/tst_qgl.cpp8
-rw-r--r--tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp2
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp14
3 files changed, 18 insertions, 6 deletions
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp
index 57128e4a82..718b5263bf 100644
--- a/tests/auto/opengl/qgl/tst_qgl.cpp
+++ b/tests/auto/opengl/qgl/tst_qgl.cpp
@@ -752,7 +752,7 @@ void tst_QGL::openGLVersionCheck()
#elif defined(QT_OPENGL_ES_2)
QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0);
#else
- if (QOpenGLFunctions::isES())
+ if (QOpenGLContext::currentContext()->isES())
QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0);
else
QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_1);
@@ -1534,7 +1534,7 @@ void tst_QGL::fboFormat()
#ifdef QT_OPENGL_ES_2
GL_RGBA;
#else
- QOpenGLFunctions::isES() ? GL_RGBA : GL_RGBA8;
+ QOpenGLContext::openGLModuleType() != QOpenGLContext::DesktopGL ? GL_RGBA : GL_RGBA8;
#endif
QCOMPARE(int(format1.internalTextureFormat()), expectedFormat);
@@ -1611,7 +1611,7 @@ void tst_QGL::fboFormat()
#ifdef QT_OPENGL_ES_2
GL_RGBA
#else
- QOpenGLFunctions::isES() ? GL_RGBA : GL_RGBA8
+ QOpenGLContext::openGLModuleType() != QOpenGLContext::DesktopGL ? GL_RGBA : GL_RGBA8
#endif
);
QVERIFY(!(format1c == format3c));
@@ -1624,7 +1624,7 @@ void tst_QGL::fboFormat()
#ifdef QT_OPENGL_ES_2
GL_RGBA
#else
- QOpenGLFunctions::isES() ? GL_RGBA : GL_RGBA8
+ QOpenGLContext::openGLModuleType() != QOpenGLContext::DesktopGL ? GL_RGBA : GL_RGBA8
#endif
);
QVERIFY(!(format1c == format4c));
diff --git a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
index fea3c7b643..cdd820cf5b 100644
--- a/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
+++ b/tests/auto/opengl/qglfunctions/tst_qglfunctions.cpp
@@ -96,7 +96,7 @@ void tst_QGLFunctions::features()
funcs.initializeGLFunctions();
// Validate the features against what we expect for this platform.
- if (QOpenGLFunctions::isES()) {
+ if (QOpenGLContext::currentContext()->isES()) {
#if !defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2)
QGLFunctions::OpenGLFeatures allFeatures =
(QGLFunctions::Multitexture |
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index 765dc221dc..999761e3f0 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -216,6 +216,11 @@ public:
{
m_gl = new QGLWidget(0, shareWidget);
moveToThread(this);
+
+ }
+
+ void moveContextToThread()
+ {
m_gl->context()->moveToThread(this);
}
@@ -307,6 +312,7 @@ void tst_QGLThreads::textureUploadInThread()
display.show();
QVERIFY(QTest::qWaitForWindowActive(&display));
+ thread.moveContextToThread();
thread.start();
while (thread.isRunning()) {
@@ -333,7 +339,7 @@ static inline float qrandom() { return (rand() % 100) / 100.f; }
void renderAScene(int w, int h)
{
- if (QOpenGLFunctions::isES()) {
+ if (QOpenGLContext::currentContext()->isES()) {
QGLFunctions funcs(QGLContext::currentContext());
Q_UNUSED(w);
Q_UNUSED(h);
@@ -630,6 +636,12 @@ class PaintThreadManager
public:
PaintThreadManager(int count) : numThreads(count)
{
+ for (int i=0; i<numThreads; ++i)
+ devices.append(new T);
+ // Wait until resize events are processed on the internal
+ // QGLWidgets of the buffers to suppress errors
+ // about makeCurrent() from the wrong thread.
+ QCoreApplication::processEvents();
for (int i=0; i<numThreads; ++i) {
devices.append(new T);
threads.append(new QThread);