diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-04-09 15:30:11 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2018-04-10 08:51:53 +0000 |
commit | 96084bf2a900dd94c2aa4eaf65b1733875b7ae4e (patch) | |
tree | 348d6d202a0785f380f19f3d0bc417b9d75897d6 /tests | |
parent | 87613492bee8365cd45e8ade4b0d7e9b77dfe9b1 (diff) |
Shuffle around Q3DSGraphicsLimits usage
Drop QOpenGLContext usage here and there in the runtime code. Also allows
autotests to see if the proper versioned context creation was functioning
and allows simplifying the checks in shared.h.
Change-Id: I6861165d92c36e2cf7f7e56cf0004f624fbbd83c
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/shared/shared.h | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/auto/shared/shared.h b/tests/auto/shared/shared.h index 6230c53..b5470e5 100644 --- a/tests/auto/shared/shared.h +++ b/tests/auto/shared/shared.h @@ -32,9 +32,7 @@ #include <QtGui/private/qguiapplication_p.h> #include <qpa/qplatformintegration.h> -#include <QOpenGLContext> -#include <QOffscreenSurface> -#include <QOpenGLFunctions> +#include <Qt3DStudioRuntime2/private/q3dsgraphicslimits_p.h> bool isOpenGLGoodEnough() { @@ -42,27 +40,19 @@ bool isOpenGLGoodEnough() if (!QGuiApplicationPrivate::instance()->platformIntegration()->hasCapability(QPlatformIntegration::OpenGL)) return false; - QOpenGLContext ctx; - if (!ctx.create()) + Q3DSGraphicsLimits gfxLimits = Q3DS::graphicsLimits(); + if (gfxLimits.versionedContextFailed) return false; - QOffscreenSurface s; - s.setFormat(ctx.format()); - s.create(); - if (!ctx.makeCurrent(&s)) + if (gfxLimits.vendor.contains(QByteArrayLiteral("VMware, Inc."))) return false; - const char *vendor = reinterpret_cast<const char *>(ctx.functions()->glGetString(GL_VENDOR)); - if (vendor && strstr(vendor, "VMware, Inc.")) + if (gfxLimits.renderer.contains(QByteArrayLiteral("Apple Software Renderer"))) return false; - const char *renderer = reinterpret_cast<const char *>(ctx.functions()->glGetString(GL_RENDERER)); - if (renderer && strstr(renderer, "Apple Software Renderer")) - return false; - if (renderer && strstr(renderer, "ANGLE")) + if (gfxLimits.renderer.contains(QByteArrayLiteral("ANGLE"))) return false; - ctx.doneCurrent(); return true; }(); |