[vlc-commits] [Git][videolan/vlc][master] 3 commits: qt: attach texture to frame buffer in `createFbo()` rather than `render()`

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jan 28 05:44:19 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
95fe7ff1 by Fatih Uzunoglu at 2025-01-28T05:27:41+00:00
qt: attach texture to frame buffer in `createFbo()` rather than `render()`

Attachment does not need to be done each time the UI is rendered.

- - - - -
dcb943ed by Fatih Uzunoglu at 2025-01-28T05:27:41+00:00
qt: bind the default fbo for draw without using `QOpenGLFramebufferObject`

- - - - -
ad324b1a by Fatih Uzunoglu at 2025-01-28T05:27:41+00:00
qt: do not use qt opengl module anymore

Not all `QOpenGL` stuff are in the Qt OpenGL
module. It appears that `QOpenGLFrameBufferObject`
was the only class provided by Qt OpenGL and
the rest are provided within Qt GUI.

- - - - -


2 changed files:

- modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
- modules/gui/qt/qt6.pro


Changes:

=====================================
modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
=====================================
@@ -25,7 +25,6 @@
 #include <QApplication>
 #include <QQuickRenderTarget>
 #include <QQuickGraphicsDevice>
-#include <QOpenGLFramebufferObject>
 #include <QOpenGLExtraFunctions>
 #include <QThread>
 #include <QBackingStore>
@@ -185,6 +184,9 @@ void CompositorX11UISurface::createFbo()
 
     f->glGenFramebuffers(1, &m_fboId);
 
+    m_context->functions()->glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fboId);
+    m_context->functions()->glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_textureId, 0);
+
     emit sizeChanged(fboSize);
 }
 
@@ -223,16 +225,15 @@ void CompositorX11UISurface::render()
     if (m_context)
     {
         m_uiRenderControl->endFrame();
-        QOpenGLFramebufferObject::bindDefault();
         m_context->functions()->glFlush();
 
         const QSize fboSize = size() * devicePixelRatio();
 
-        m_context->functions()->glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fboId);
-        m_context->functions()->glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_textureId, 0);
         //qt may mess with scissor/viewport
         m_context->functions()->glScissor(0,0, fboSize.width(), fboSize.height());
         m_context->extraFunctions()->glViewport(0,0, fboSize.width(), fboSize.height());
+        m_context->functions()->glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fboId);
+        m_context->functions()->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_context->defaultFramebufferObject());
         m_context->extraFunctions()->glBlitFramebuffer(0, 0, fboSize.width(), fboSize.height(), 0, 0, fboSize.width(), fboSize.height(), GL_COLOR_BUFFER_BIT, GL_NEAREST);
         m_context->swapBuffers(this);
     }


=====================================
modules/gui/qt/qt6.pro
=====================================
@@ -18,7 +18,6 @@ QTPLUGIN += qwindowsvistastyle
 }
 
 linux {
-QT += opengl # compositor_x11 requires Qt OpenGL
 QTPLUGIN += qxcb-glx-integration qxcb-egl-integration qxcb qwayland-generic qwayland-egl qgtk3 qxdgdesktopportal xdg-shell
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/df9db4263889fd2c7e38236234e26c0ce3a22e64...ad324b1a7a69bf939756067bd17609b5b3c76aab

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/df9db4263889fd2c7e38236234e26c0ce3a22e64...ad324b1a7a69bf939756067bd17609b5b3c76aab
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