[vlc-commits] [Git][videolan/vlc][master] qml: do not let qt to create implicit layer in player blurred background
François Cartegnie (@fcartegnie)
gitlab at videolan.org
Mon Jan 27 20:08:12 UTC 2025
François Cartegnie pushed to branch master at VideoLAN / VLC
Commits:
df9db426 by Fatih Uzunoglu at 2025-01-27T19:55:46+00:00
qml: do not let qt to create implicit layer in player blurred background
Here, Qt wants to create a layer because when source is `QQuickImage`,
`QGfxSourceProxyME` checks its fill mode and source size.
In this case, we need to tell Qt that we don't need a layer here, as
we are doing the mapping as we want but Qt currently does not offer
a way to tell that and simply tries to decide itself: "If needed,
MultiEffect will internally generate a ShaderEffectSource as the
texture source"
- - - - -
1 changed file:
- modules/gui/qt/player/qml/Player.qml
Changes:
=====================================
modules/gui/qt/player/qml/Player.qml
=====================================
@@ -288,7 +288,28 @@ FocusScope {
width: (cover.sar < dar) ? parent.width : parent.height * cover.sar
height: (cover.sar < dar) ? parent.width / cover.sar : parent.height
- source: cover
+ source: textureProviderItem
+
+ Widgets.TextureProviderItem {
+ // Texture indirection to fool Qt into not creating an implicit
+ // ShaderEffectSource because source image does not have fill mode
+ // stretch. "If needed, MultiEffect will internally generate a
+ // ShaderEffectSource as the texture source.": Qt creates a layer
+ // if source has children, source is image and does not have
+ // fill mode stretch or source size is null. In this case,
+ // we really don't need Qt to create an implicit layer.
+
+ // Note that this item does not create a new texture, it simply
+ // represents the source image provider.
+ id: textureProviderItem
+
+ // Do not set textureSubRect, because we don't want blur to be
+ // updated everytime the viewport changes. It is better to have
+ // the static source texture blurred once, and adjust the blur
+ // than to blur each time the viewport changes.
+
+ source: cover
+ }
layer.enabled: true
layer.samplerName: "backgroundSource"
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/df9db4263889fd2c7e38236234e26c0ce3a22e64
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/df9db4263889fd2c7e38236234e26c0ce3a22e64
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