summaryrefslogtreecommitdiff
path: root/src/core/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/api')
-rw-r--r--src/core/api/configure.cmake10
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp33
2 files changed, 28 insertions, 15 deletions
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index 4e54ad2a9..333039a42 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -150,6 +150,12 @@ qt_feature("webengine-sanitizer" PRIVATE
AUTODETECT CLANG
CONDITION CLANG AND ECM_ENABLE_SANITIZERS
)
+qt_feature("webengine-vulkan" PRIVATE
+ SECTION "WebEngine"
+ LABEL "Vulkan support"
+ PURPOSE "Enables support for Vulkan rendering"
+ CONDITION QT_FEATURE_vulkan
+)
# internal testing feature
qt_feature("webengine-system-poppler" PRIVATE
LABEL "popler"
@@ -178,6 +184,10 @@ qt_configure_add_summary_entry(
CONDITION UNIX
)
qt_configure_add_summary_entry(
+ ARGS "webengine-vulkan"
+ CONDITION QT_FEATURE_vulkan
+)
+qt_configure_add_summary_entry(
ARGS "webengine-v8-snapshot-support"
CONDITION UNIX AND cross_compile
)
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 3c2eefdf5..1dded1086 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -195,22 +195,25 @@ sandbox::SandboxInterfaceInfo *staticSandboxInterfaceInfo(sandbox::SandboxInterf
static void initialize()
{
#if QT_CONFIG(opengl)
- if (QCoreApplication::instance()) {
- // On window/ANGLE, calling QtWebEngineQuick::initialize from DllMain will result in a crash.
- if (!qt_gl_global_share_context() &&
- !(QCoreApplication::testAttribute(Qt::AA_ShareOpenGLContexts) &&
- QQuickWindow::graphicsApi() == QSGRendererInterface::OpenGLRhi)
- ) {
- qWarning("Qt WebEngine seems to be initialized from a plugin. Please "
- "set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute and "
- "QSGRendererInterface::OpenGLRhi using QQuickWindow::setGraphicsApi "
- "before constructing QGuiApplication.");
+ if (QCoreApplication::instance()) {
+ // On Windows/ANGLE, calling QtWebEngineQuick::initialize from DllMain will result in a
+ // crash.
+ if (!qt_gl_global_share_context()
+ && !(QCoreApplication::testAttribute(Qt::AA_ShareOpenGLContexts)
+ && QQuickWindow::graphicsApi() == QSGRendererInterface::OpenGLRhi)) {
+ qWarning("Qt WebEngine seems to be initialized from a plugin. Please "
+ "set Qt::AA_ShareOpenGLContexts using QCoreApplication::setAttribute and "
+ "QSGRendererInterface::OpenGLRhi using QQuickWindow::setGraphicsApi "
+ "before constructing QGuiApplication.");
+ }
+ return;
}
- return;
- }
- // QCoreApplication is not yet instantiated, ensuring the call will be deferred
- qAddPreRoutine(QtWebEngineCore::initialize);
- QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
+
+ // QCoreApplication is not yet instantiated, ensuring the call will be deferred
+ qAddPreRoutine(QtWebEngineCore::initialize);
+ auto api = QQuickWindow::graphicsApi();
+ if (api != QSGRendererInterface::OpenGLRhi && api != QSGRendererInterface::VulkanRhi)
+ QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi);
#endif // QT_CONFIG(opengl)
}