summaryrefslogtreecommitdiff
path: root/src/core/api
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2022-10-27 14:33:16 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2022-11-10 09:42:16 +0100
commitb32f5e5b495ef73f25d3156d24a83fffd33f02be (patch)
tree5651504ad55f3609163c85879e0ac6d726c6db27 /src/core/api
parent6fb80f47941b555f1a9455d3bd3d189b90092b60 (diff)
downloadqtwebengine-b32f5e5b495ef73f25d3156d24a83fffd33f02be.tar.gz
Add Vulkan rendering support
Updates 3rdparty: * 8b7ce4ef70d Make GrVkImage external Task-number: QTBUG-107669 Change-Id: If7fbe1f20538598dd1d4f3a67be17c9f7d06a3cd Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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)
}