[vlc-commits] [Git][videolan/vlc][master] qt: fix irregular shadows with extended window frame

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Aug 4 13:04:51 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d60115fd by Prince Gupta at 2023-08-04T11:33:07+00:00
qt: fix irregular shadows with extended window frame

use explicit size to specify render rect

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
=====================================
@@ -45,6 +45,16 @@
 
 using namespace vlc;
 
+namespace
+{
+
+void assertUint16Range(int value)
+{
+    assert(value >= 0 && value <= std::numeric_limits<uint16_t>::max());
+}
+
+}
+
 RenderTask::RenderTask(qt_intf_t *intf, xcb_connection_t* conn, xcb_drawable_t wid,
                        QMutex& pictureLock, QObject *parent)
     : QObject(parent)
@@ -80,7 +90,12 @@ void RenderTask::render(unsigned int requestId)
     {
         //clear screen
         xcb_render_color_t clear = { 0x0000, 0x0000, 0x0000, 0x0000 };
-        xcb_rectangle_t rect = {0, 0, 0xFFFF, 0xFFFF};
+
+
+        xcb_rectangle_t rect = {0, 0
+                                , static_cast<uint16_t>(m_renderSize.width())
+                                , static_cast<uint16_t>(m_renderSize.height())};
+
         xcb_render_fill_rectangles(m_conn, XCB_RENDER_PICT_OP_SRC, drawingarea,
                                    clear, 1, &rect);
     }
@@ -134,6 +149,11 @@ void RenderTask::onWindowSizeChanged(const QSize& newSize)
         m_renderSize.setWidth(vlc_align(newSize.width(), 128));
         m_renderSize.setHeight(vlc_align(newSize.height(), 128));
     }
+
+    // paint function takes uint16
+    assertUint16Range(m_renderSize.width());
+    assertUint16Range(m_renderSize.height());
+
     m_resizeRequested = true;
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d60115fd5bcaa12fe0b93a650c1bccc6ba2c2eb2

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