[vlc-commits] [Git][videolan/vlc][master] 4 commits: qt: add updated signal in x11 ui surface

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Sep 8 12:51:10 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
bc3833ed by Prince Gupta at 2022-09-08T12:27:04+00:00
qt: add updated signal in x11 ui surface

signal is called after frame is presented

- - - - -
4c6903e7 by Prince Gupta at 2022-09-08T12:27:04+00:00
qt: refresh x11 compositor after updating frame

afterRendering is emitted before the frame is presented, on
afterRendering signal we update the x11 compositor but the frame is not
presented yet, so the compositor paints the old frame instead of new one

fixes #27188

- - - - -
ba7c3ef3 by Prince Gupta at 2022-09-08T12:27:04+00:00
qt: improve comment

compositor is multithreaded, renderer is single threaded

- - - - -
5acf302a by Prince Gupta at 2022-09-08T12:27:04+00:00
qt: disable double buffering for qml view in x11 compositor

- - - - -


3 changed files:

- modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
- modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
- modules/gui/qt/maininterface/compositor_x11_uisurface.hpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
=====================================
@@ -395,7 +395,7 @@ bool CompositorX11RenderWindow::startRendering()
     m_renderTask->moveToThread(m_renderThread);
     connect(m_renderThread, &QThread::finished, m_renderTask, &QObject::deleteLater);
 
-    connect(m_interfaceWindow, &CompositorX11UISurface::afterRendering, m_renderTask, &RenderTask::requestRefresh);
+    connect(m_interfaceWindow, &CompositorX11UISurface::updated, m_renderTask, &RenderTask::requestRefresh);
     connect(m_interfaceWindow, &CompositorX11UISurface::sizeChanged, m_renderTask, &RenderTask::onInterfaceSizeChanged);
 
     connect(this, &CompositorX11RenderWindow::windowSizeChanged, m_renderTask, &RenderTask::onWindowSizeChanged);


=====================================
modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
=====================================
@@ -37,6 +37,10 @@ CompositorX11UISurface::CompositorX11UISurface(QWindow* window, QScreen* screen)
     format.setStencilBufferSize(8);
     format.setAlphaBufferSize(8);
     format.setSwapInterval(0);
+
+    // UI is renderred on offscreen, no need for double bufferring
+    format.setSwapBehavior(QSurfaceFormat::SingleBuffer);
+
     setFormat(format);
 
     m_context = new QOpenGLContext();
@@ -133,13 +137,15 @@ void CompositorX11UISurface::render()
     m_uiRenderControl->polishItems();
     m_uiRenderControl->sync();
 
-    // FIXME: Render function should be executed in rendering thread
+    // TODO: investigate multithreaded renderer
     m_uiRenderControl->render();
 
     m_uiWindow->resetOpenGLState();
 
     m_context->functions()->glFlush();
     m_context->swapBuffers(this);
+
+    emit updated();
 }
 
 void CompositorX11UISurface::updateSizes()


=====================================
modules/gui/qt/maininterface/compositor_x11_uisurface.hpp
=====================================
@@ -64,6 +64,7 @@ signals:
     void beforeRendering();
     void afterRendering();
     void sizeChanged(const QSize& size);
+    void updated();
 
 protected:
     bool event(QEvent *event) override;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/317f1f95694cc29b3615a80f016a4b6f29e46ec3...5acf302a46041b99ada6f4d5a39b5768ae9eeea5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/317f1f95694cc29b3615a80f016a4b6f29e46ec3...5acf302a46041b99ada6f4d5a39b5768ae9eeea5
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