Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
dc01dff0 by Fatih Uzunoglu at 2025-11-05T14:21:33+00:00
qml: extend the bottom and top edges of the miniplayer backdrop effect
This fixes the glitching observed at the bottom, and to a less considerable
extent, top edge of the miniplayer's backdrop blur effect, particularly
when scrolling the main view.
- - - - -
a1ded625 by Fatih Uzunoglu at 2025-11-05T14:21:33+00:00
qml: use fixed size for effect rect height in `MainDisplay`
The height of the effect is not supposed to be animated, we
can use fixed height here. This is useful for the effect,
especially with multiple passes because then the layers do
not need to be recreated due to size changes.
- - - - -
1 changed file:
- modules/gui/qt/maininterface/qml/MainDisplay.qml
Changes:
=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -253,15 +253,43 @@ FocusScope {
(GraphicsInfo.shaderType ===
GraphicsInfo.RhiShader) &&
(miniPlayer.visible || (loaderProgress.active
&& loaderProgress.item.visible))
+ // Blurring requires to access neighbour pixels, thus the
source texture should be bigger than
+ // the effect so that the effect have access to the neighbor
pixels for the pixels near the
+ // border, where the extra size would depend on the blur
configuration. When the source is
+ // static, this problem is harder to notice, but when the
source is not static, such as
+ // during scrolling, not considering this causes glitches in
the bottom side. `PartialEffect`,
+ // since 03b0de26, already provides the effect the whole
source texture with a proper sub-rect,
+ // so the effect here can sample the top edge neighbour
pixels, but for the bottom edge we
+ // need to configure the layer:
+ readonly property int bottomExtension: 16
+ layer.sourceRect: Qt.rect(0, 0, width, height +
bottomExtension)
+
+ Rectangle {
+ // Extension of parent rectangle for the bottom extension.
+ anchors.top: parent.bottom
+ anchors.left: parent.left
+ anchors.right: parent.right
+ height: stackViewParent.bottomExtension
+ visible: stackViewParent.layer.enabled && (height > 0)
+ color: parent.color
+ }
+
layer.effect: Widgets.PartialEffect {
id: stackViewParentLayerEffect
+ // Setting `height` does not seem to work here. Anchoring
the effect is not very nice, but it works:
+ anchors.fill: parent
+ anchors.bottomMargin: -stackViewParent.bottomExtension
+
blending: stackViewParent.color.a < (1.0 - Number.EPSILON)
+ // Each pass of the blur effect also suffers from the
border neighbour pixel issue mentioned
+ // above, making all the borders problematic, to a less
considerable extent. For that reason,
+ // we extend both the top and the bottom edges and use
viewport to prevent overdraw:
effectRect: Qt.rect(0,
- stackView.height,
+ stackView.height -
stackViewParent.bottomExtension,
width,
- height - stackView.height)
+ loaderProgress.height +
miniPlayer.height + 2 * stackViewParent.bottomExtension)
sourceVisualRect: blending ? Qt.rect(0, 0, width,
effectRect.y) : Qt.rect(0, 0, 0, 0)
@@ -277,6 +305,12 @@ FocusScope {
}
tint: frostedTheme.bg.secondary
+
+ // Prevent overdraw (the extension margin should not
be painted):
+ viewportRect: Qt.rect(0,
+ stackViewParent.bottomExtension,
+ width,
+ height - (2 *
stackViewParent.bottomExtension))
}
}
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/b37fe51cd272877076f95a3cdf32997497042e06...a1ded625701e8dee33828479733cb262d0c04d8f
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/compare/b37fe51cd272877076f95a3cdf32997497042e06...a1ded625701e8dee33828479733cb262d0c04d8f
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits