summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-01-28 12:34:18 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-01-28 16:52:59 +0100
commit1bd60749d140d14d152b59eccbda4790c517c54e (patch)
tree37bc2c92cd98321165ea3c17e38f319e089bdb32
parentMerge "Merge remote-tracking branch 'origin/5.15' into dev" (diff)
downloadqtbase-1bd60749d140d14d152b59eccbda4790c517c54e.tar.xz
qtbase-1bd60749d140d14d152b59eccbda4790c517c54e.zip
QOpenGLContext: use extraFunctions instead of versioned functions
Task-number: QTBUG-74409 Change-Id: I548cd4b683cbf67c9716d424b48fdc8b3f6a8c09 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/gui/kernel/qopenglcontext.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index fbaff74561..6915433aed 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -372,20 +372,8 @@ int QOpenGLContextPrivate::maxTextureSize()
GLint next = 64;
funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
- QOpenGLFunctions_1_0 *gl1funcs = nullptr;
- QOpenGLFunctions_3_2_Core *gl3funcs = nullptr;
-
- if (q->format().profile() == QSurfaceFormat::CoreProfile)
- gl3funcs = q->versionFunctions<QOpenGLFunctions_3_2_Core>();
- else
- gl1funcs = q->versionFunctions<QOpenGLFunctions_1_0>();
-
- Q_ASSERT(gl1funcs || gl3funcs);
-
- if (gl1funcs)
- gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size);
- else
- gl3funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size);
+ QOpenGLExtraFunctions *extraFuncs = q->extraFunctions();
+ extraFuncs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size);
if (size == 0) {
return max_texture_size;
@@ -397,11 +385,7 @@ int QOpenGLContextPrivate::maxTextureSize()
if (next > max_texture_size)
break;
funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
- if (gl1funcs)
- gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next);
- else
- gl3funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next);
-
+ extraFuncs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next);
} while (next > size);
max_texture_size = size;