diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-10-20 13:18:59 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2015-10-22 10:08:51 +0000 |
commit | 31f9c57bc50ae053cfaf039a1dfdb128e2494458 (patch) | |
tree | 316138cb73c49877f5a80a8496c2f1b737122fb5 /src/datavisualization/utils | |
parent | 4162ddeb02ee41fd4217d7f3d93d45cab3313ba8 (diff) |
Fix issues with COIN builds
-Fix miscellaneous compile errors
-Move manual tests to manual folder and enable export of autotests
-Added widgets requirement
-Fixed autotests
-Fixed renderer and controller synchronization in QML case
-Treat fallback Mesa as ES2 similar to setting AA_UseSoftwareOpenGL
Change-Id: If6619733725d079e339bef16262e5ea1450ab20f
Reviewed-by: Tomi Korpipää <tomi.korpipaa@theqtcompany.com>
Diffstat (limited to 'src/datavisualization/utils')
-rw-r--r-- | src/datavisualization/utils/qutils.h | 21 | ||||
-rw-r--r-- | src/datavisualization/utils/texturehelper.cpp | 3 | ||||
-rw-r--r-- | src/datavisualization/utils/utils.cpp | 19 |
3 files changed, 26 insertions, 17 deletions
diff --git a/src/datavisualization/utils/qutils.h b/src/datavisualization/utils/qutils.h index 22937cae..6bf995b7 100644 --- a/src/datavisualization/utils/qutils.h +++ b/src/datavisualization/utils/qutils.h @@ -24,12 +24,14 @@ #include <QtGui/QSurfaceFormat> #include <QtGui/QOpenGLContext> +#include <QtGui/QOpenGLFunctions> #include <QtGui/QOffscreenSurface> #include <QtCore/QCoreApplication> namespace QtDataVisualization { -inline static QSurfaceFormat qDefaultSurfaceFormat(bool antialias = true) +static inline QSurfaceFormat qDefaultSurfaceFormat(bool antialias = true) Q_DECL_UNUSED; +static inline QSurfaceFormat qDefaultSurfaceFormat(bool antialias) { bool isES = false; @@ -61,20 +63,23 @@ inline static QSurfaceFormat qDefaultSurfaceFormat(bool antialias = true) isES = ctx->isOpenGLES(); #endif - if (dummySurface) { - ctx->doneCurrent(); - delete ctx; - delete dummySurface; - } - #if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) // We support only ES2 emulation with software renderer for now - if (QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL)) { + const GLubyte *openGLVersion = ctx->functions()->glGetString(GL_VERSION); + QString versionStr = QString::fromLatin1((const char *)openGLVersion).toLower(); + if (versionStr.contains(QStringLiteral("mesa")) + || QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL)) { qWarning("Only OpenGL ES2 emulation is available for software rendering."); isES = true; } #endif + if (dummySurface) { + ctx->doneCurrent(); + delete ctx; + delete dummySurface; + } + if (isES) { // For ES2 only attributes surfaceFormat.setRedBufferSize(8); diff --git a/src/datavisualization/utils/texturehelper.cpp b/src/datavisualization/utils/texturehelper.cpp index 179525f1..05439665 100644 --- a/src/datavisualization/utils/texturehelper.cpp +++ b/src/datavisualization/utils/texturehelper.cpp @@ -337,7 +337,8 @@ GLuint TextureHelper::createDepthTextureFrameBuffer(const QSize &size, GLuint &f void TextureHelper::deleteTexture(GLuint *texture) { if (texture && *texture) { - glDeleteTextures(1, texture); + if (QOpenGLContext::currentContext()) + glDeleteTextures(1, texture); *texture = 0; } } diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp index a3809733..e67e636f 100644 --- a/src/datavisualization/utils/utils.cpp +++ b/src/datavisualization/utils/utils.cpp @@ -20,11 +20,11 @@ ******************************************************************************/ #include "utils_p.h" -#include "qutils.h" #include <QtGui/QPainter> #include <QtGui/QOpenGLContext> #include <QtGui/QOffscreenSurface> +#include <QtCore/QCoreApplication> QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -352,20 +352,23 @@ void Utils::resolveStatics() ctx->functions()->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); - if (dummySurface) { - ctx->doneCurrent(); - delete ctx; - delete dummySurface; - } - #if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)) // We support only ES2 emulation with software renderer for now - if (QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL)) { + const GLubyte *openGLVersion = ctx->functions()->glGetString(GL_VERSION); + QString versionStr = QString::fromLatin1((const char *)openGLVersion).toLower(); + if (versionStr.contains(QStringLiteral("mesa")) + || QCoreApplication::testAttribute(Qt::AA_UseSoftwareOpenGL)) { qWarning("Only OpenGL ES2 emulation is available for software rendering."); isES = true; } #endif + if (dummySurface) { + ctx->doneCurrent(); + delete ctx; + delete dummySurface; + } + staticsResolved = true; } |