diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-08-30 20:54:00 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-09-04 07:15:06 +0200 |
commit | 8548008f53bbcebf65580304c89ea9d2a265bd85 (patch) | |
tree | 005398b2e18bcec7205d6c70f74c67dd352ba142 /src/core/web_engine_context.cpp | |
parent | 1bdc7956e7065bf73413109182c215bcefe2d817 (diff) |
Enable no opengl builds
By mistake opengl was marked as required library, but
should be just optional.
Fix compilation issues.
This should enable build on yet another coin node.
Pick-to: 6.2
Change-Id: Id87404928e6b042d902fcfe0a7fed99a6806456f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_engine_context.cpp')
-rw-r--r-- | src/core/web_engine_context.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index c9f82c31c..24df73bc8 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -132,8 +132,8 @@ #include <QMutex> #include <QOffscreenSurface> #if QT_CONFIG(opengl) -# include <QOpenGLContext> -# include <qopenglcontext_platform.h> +#include <QOpenGLContext> +#include <qopenglcontext_platform.h> #endif #include <QQuickWindow> #include <QStringList> @@ -246,7 +246,7 @@ static const char *getGLType(bool enableGLSoftwareRendering) return glType; } #else -static cont char *getGLType(bool enableGLSoftwareRendering) +static const char *getGLType(bool enableGLSoftwareRendering) { return nullptr; } @@ -262,6 +262,7 @@ static void logContext(const char *glType, base::CommandLine *cmd) { QLoggingCategory webEngineContextLog("qt.webenginecontext"); if (webEngineContextLog.isInfoEnabled()) { +#if QT_CONFIG(opengl) const QSurfaceFormat sharedFormat = qt_gl_global_share_context()->format(); const auto profile = QMetaEnum::fromType<QSurfaceFormat::OpenGLContextProfile>().valueToKey( sharedFormat.profile()); @@ -284,6 +285,9 @@ static void logContext(const char *glType, base::CommandLine *cmd) glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(), usingDefaultSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no", usingANGLE() ? "yes" : "no", qPrintable(params.join(" "))); +#else + qCInfo(webEngineContextLog) << "WebEngine compiled with no opengl enabled."; +#endif //QT_CONFIG(opengl) } } @@ -737,6 +741,7 @@ WebEngineContext::WebEngineContext() const char *glType = getGLType(enableGLSoftwareRendering); if (glType) { +#if QT_CONFIG(opengl) parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType); parsedCommandLine->AppendSwitch(switches::kInProcessGPU); if (enableGLSoftwareRendering) { @@ -766,6 +771,7 @@ WebEngineContext::WebEngineContext() if (!usingANGLE() || isGLES2Context) parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext); #endif +#endif //QT_CONFIG(opengl) } else { parsedCommandLine->AppendSwitch(switches::kDisableGpu); } |