[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: setup dcomp integration only if the graphics api is appropriate

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jun 11 15:06:11 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
4ee7af63 by Fatih Uzunoglu at 2024-06-11T14:45:56+00:00
qt: setup dcomp integration only if the graphics api is appropriate

- - - - -
4cbd406c by Fatih Uzunoglu at 2024-06-11T14:45:56+00:00
qt: use direct connection in scene graph instantiation in compositor_dcomp

- - - - -


1 changed file:

- modules/gui/qt/maininterface/compositor_dcomp.cpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -215,12 +215,6 @@ bool CompositorDirectComposition::makeMainInterface(MainCtx* mainCtx)
     m_quickView->setResizeMode(QQuickView::SizeRootObjectToView);
     m_quickView->setColor(Qt::transparent);
 
-    connect(quickViewPtr,
-            &QQuickWindow::frameSwapped, // At this stage, we can be sure that QRhi and QRhiSwapChain are valid.
-            this,
-            &CompositorDirectComposition::setup,
-            Qt::SingleShotConnection);
-
     m_quickView->installEventFilter(this);
 
     bool appropriateGraphicsApi = true;
@@ -229,13 +223,22 @@ bool CompositorDirectComposition::makeMainInterface(MainCtx* mainCtx)
     connect(quickViewPtr,
             &QQuickWindow::sceneGraphInitialized,
             &eventLoop,
-            [&eventLoop, &appropriateGraphicsApi]() {
-                if (!(QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11 ||
-                      QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D12)) {
+            [&eventLoop, &appropriateGraphicsApi, quickViewPtr, this]() {
+                if (QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D11 ||
+                    QQuickWindow::graphicsApi() == QSGRendererInterface::Direct3D12)
+                {
+                    connect(quickViewPtr,
+                            &QQuickWindow::frameSwapped, // At this stage, we can be sure that QRhi and QRhiSwapChain are valid.
+                            this,
+                            &CompositorDirectComposition::setup,
+                            Qt::SingleShotConnection);
+                }
+                else
+                {
                     appropriateGraphicsApi = false;
                 }
                 eventLoop.quit();
-        }, Qt::SingleShotConnection);
+        }, static_cast<Qt::ConnectionType>(Qt::SingleShotConnection | Qt::DirectConnection));
 
     connect(quickViewPtr,
             &QQuickWindow::sceneGraphError,
@@ -244,7 +247,7 @@ bool CompositorDirectComposition::makeMainInterface(MainCtx* mainCtx)
                 qWarning() << "CompositorDComp: Scene Graph Error: " << error << ", Message: " << message;
                 appropriateGraphicsApi = false;
                 eventLoop.quit();
-        }, Qt::SingleShotConnection);
+        }, static_cast<Qt::ConnectionType>(Qt::SingleShotConnection | Qt::DirectConnection));
 
     CompositorVideo::Flags flags = CompositorVideo::CAN_SHOW_PIP | CompositorVideo::HAS_ACRYLIC;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/70ca0e41310296f86c5378a6f490a9ce626b0b58...4cbd406cb8996b99c8434acd260acf23c834e9b9

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/70ca0e41310296f86c5378a6f490a9ce626b0b58...4cbd406cb8996b99c8434acd260acf23c834e9b9
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list