[vlc-commits] [Git][videolan/vlc][master] qml: make window glow effect hollow only when the window is translucent
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Nov 23 13:49:02 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
7c9fef82 by Fatih Uzunoglu at 2024-11-23T13:18:38+00:00
qml: make window glow effect hollow only when the window is translucent
The hollow shader discards the pixels that are in the interior area. It
is known that branching in fragment shader should be avoided if possible.
By checking if the window is opaque, we can disable hollowing and use it
only if the window is translucent or transparent (due to window backdrop
blur effect).
The glow effect should not act as a filter for the window backdrop blur,
it is only used for providing a glow effect around the edges. This was
the reason of coming up with the possibility of hollowing.
Currently, areas of the interface that want to show the window backdrop
effect use a hack to "punch a hole" as they are placed deep down in
the scene graph hierarchy and in certain cases parent item(s) provide
background color.
This hack is done by simply disabling blending but still painting with
translucent colors (see `ViewBlockingRectangle`). In this case, it does
not really matter if the glow effect here is hollow or not, because the
areas that want to pass the backdrop effect disabling blending means that
the glow effect would not be visible behind those areas anyway.
However, "punching hole" hack has been used as a convenience when it is
necessary. In the future, the areas that want to pass the backdrop effect
should placed in the scene graph hierarchy so that there is no item in
beneath that is opaque. This is possibly impossible for the PIP player,
but there are currently places in the interface that this can be done,
such as the top bar. So, for these cases, we need hollowing so that the
glow effect does not appear (and act as a filter) in the interface main
area.
- - - - -
1 changed file:
- modules/gui/qt/maininterface/qml/MainInterface.qml
Changes:
=====================================
modules/gui/qt/maininterface/qml/MainInterface.qml
=====================================
@@ -330,7 +330,7 @@ Item {
Widgets.RectangularGlow {
id: effect
z: -1
- hollow: true // hollow because the interface may be translucent if the window has backdrop blur
+ hollow: Window.window && (Window.window.color.a < 1.0) // the interface may be translucent if the window has backdrop blur
blending: false // stacked below everything, no need for blending even though it is not opaque
visible: _extendedFrameVisible
anchors.fill: g_mainInterface
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7c9fef82467a0e79c226db883bd12ad328d84cc9
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7c9fef82467a0e79c226db883bd12ad328d84cc9
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