[vlc-commits] [Git][videolan/vlc][master] qml: limit the layer size to area of interest in `MainDisplay`
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Mon Mar 23 13:51:08 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
2630a5cd by Fatih Uzunoglu at 2026-03-23T13:58:15+01:00
qml: limit the layer size to area of interest in `MainDisplay`
We can do this now because `PartialEffect` provides a way to
adjust the `sourceVisualRect`.
This reduces the amount of video memory required, because the
area beneath the playqueue is not used. We still have to keep
the layering at `stackViewParent` level because the effect
width exceeds the `stackView` width. The amount of saved
memory depends on how big the playqueue is, where if the
playqueue is not shown there is no difference.
We still do not need to use background coloring in the effect,
even though `DualKawaseBlur` provides it, because due to
`ClampToEdge` the background is extended naturally.
It is currently a todo to further reduce the VRAM consumption
by trimming the intermediate layer size within the effect,
since we do not need to apply blurring in the plain area which
has only one unique color (the background color).
- - - - -
1 changed file:
- modules/gui/qt/maininterface/qml/MainDisplay.qml
Changes:
=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -262,7 +262,15 @@ FocusScope {
// 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)
+ // The layer width is smaller than the item width, this is intentional because we do not want
+ // to include the area that playqueue occupies in the layer since it is empty. Note that we
+ // still want to do layering here, because even though the layer is smaller than the item
+ // size, what we display is covered by the item size. The effect, which needs to cover the
+ // item width is going to respect the empty area due to clamp to edge behavior, so we don't
+ // need to use background coloring. It is currently a todo to further reduce video memory
+ // consumption by covering the effect for only the area of interest, currently the blur
+ // effect does not support having an extension area for postprocessing.
+ layer.sourceRect: Qt.rect(0, 0, stackView.width, height + bottomExtension)
Rectangle {
// Extension of parent rectangle for the bottom extension.
@@ -291,7 +299,14 @@ FocusScope {
width,
loaderProgress.height + miniPlayer.height + 2 * stackViewParent.bottomExtension)
- sourceVisualRect: blending ? Qt.rect(0, 0, width, effectRect.y) : Qt.rect(0, 0, 0, 0)
+ // Bottom extension is not necessary here, but it is provided to prevent stretching glitch at
+ // initialization. Currently this is not a problem because the effect is opaque since the
+ // background is opaque, and effect visual has higher z than the source visual.
+ sourceVisualRect: ((stackView.width < stackViewParent.width) || blending) ?
+ Qt.rect(0, 0,
+ stackView.width,
+ stackView.height + (frostedGlassEffect.blending ? 0 : stackViewParent.bottomExtension)) :
+ Qt.rect(0, 0, 0, 0)
effect: frostedGlassEffect
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2630a5cd40fa7c28cc50fbde697f12b79559e513
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2630a5cd40fa7c28cc50fbde697f12b79559e513
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list