[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: ditch `readyForVisibility` in `DropShadowImage`

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Mar 13 03:26:16 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7529adba by Fatih Uzunoglu at 2026-03-13T03:01:57+00:00
qml: ditch `readyForVisibility` in `DropShadowImage`

It was introduced for the case of calling
`grabToImage()` while the item is invisible.

This was a problem in `DragItem`, but since
02a370ef it is no longer the case. So we do
not need this property anymore.

It can be re-introduced if in the future there
is a valid reason again.

- - - - -
1269a691 by Fatih Uzunoglu at 2026-03-13T03:01:57+00:00
qml: ditch `readyForVisibility` in `ImageExt`

It was introduced for the case of calling
`grabToImage()` while the item is invisible.

This was a problem in `DragItem`, but since
02a370ef it is no longer the case. So we do
not need this property anymore.

It can be re-introduced if in the future there
is a valid reason again.

- - - - -


2 changed files:

- modules/gui/qt/widgets/qml/DropShadowImage.qml
- modules/gui/qt/widgets/qml/ImageExt.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/DropShadowImage.qml
=====================================
@@ -55,7 +55,7 @@ Item {
         cache: true
         asynchronous: true
 
-        visible: !visualDelegate.readyForVisibility
+        visible: !visualDelegate.visible
 
         fillMode: Image.Stretch
 
@@ -96,9 +96,7 @@ Item {
         width: image.paintedWidth
         height: image.paintedHeight
 
-        visible: readyForVisibility
-
-        readonly property bool readyForVisibility: (GraphicsInfo.shaderType === GraphicsInfo.RhiShader)
+        visible: (GraphicsInfo.shaderType === GraphicsInfo.RhiShader)
 
         supportsAtlasTextures: true
         blending: true


=====================================
modules/gui/qt/widgets/qml/ImageExt.qml
=====================================
@@ -36,8 +36,8 @@ Item {
     // Implicit size used to be overridden as readonly, but that needed
     // binding width/height to the new properties which in turn caused
     // problems with layouts.
-    implicitWidth: shaderEffect.readyForVisibility ? shaderEffect.implicitWidth : image.implicitWidth
-    implicitHeight: shaderEffect.readyForVisibility ? shaderEffect.implicitHeight : image.implicitHeight
+    implicitWidth: shaderEffect.visible ? shaderEffect.implicitWidth : image.implicitWidth
+    implicitHeight: shaderEffect.visible ? shaderEffect.implicitHeight : image.implicitHeight
 
     antialiasing: true
 
@@ -86,13 +86,13 @@ Item {
     // uses to shrink to prevent "hard edges". Note that padding can only be calculated properly
     // when the shader has custom softedge support (`CUSTOM_SOFTEDGE`), currently it is used
     // at all times.
-    readonly property real padding: (shaderEffect.readyForVisibility && antialiasing) ? (Math.max(shaderEffect.width, shaderEffect.height) / 4 * shaderEffect.softEdgeMax)
-                                                                                      : 0.0
+    readonly property real padding: (shaderEffect.visible && antialiasing) ? (Math.max(shaderEffect.width, shaderEffect.height) / 4 * shaderEffect.softEdgeMax)
+                                                                           : 0.0
 
-    readonly property real paintedWidth: (shaderEffect.readyForVisibility) ? shaderEffect.width
-                                                                           : (image.clip ? image.width : image.paintedWidth)
-    readonly property real paintedHeight: (shaderEffect.readyForVisibility) ? shaderEffect.height
-                                                                            : (image.clip ? image.height : image.paintedHeight)
+    readonly property real paintedWidth: (shaderEffect.visible) ? shaderEffect.width
+                                                                : (image.clip ? image.width : image.paintedWidth)
+    readonly property real paintedHeight: (shaderEffect.visible) ? shaderEffect.height
+                                                                 : (image.clip ? image.height : image.paintedHeight)
 
     // NOTE: ImageExt calculates the painted size at all times,
     //       regardless of whether a foreign texture provider
@@ -117,10 +117,10 @@ Item {
     property real radiusTopLeft: radius
     property real radiusBottomRight: radius
     property real radiusBottomLeft: radius
-    readonly property real effectiveRadius: shaderEffect.readyForVisibility ? Math.max(radiusTopRight, radiusTopLeft, radiusBottomRight, radiusBottomLeft) : 0.0
+    readonly property real effectiveRadius: shaderEffect.visible ? Math.max(radiusTopRight, radiusTopLeft, radiusBottomRight, radiusBottomLeft) : 0.0
 
     property color backgroundColor: "transparent"
-    readonly property color effectiveBackgroundColor: shaderEffect.readyForVisibility ? backgroundColor : "transparent"
+    readonly property color effectiveBackgroundColor: shaderEffect.visible ? backgroundColor : "transparent"
 
     property alias blending: shaderEffect.blending
     blending: (effectiveRadius > 0.0) || (effectiveBackgroundColor.a < 1.0)
@@ -134,7 +134,7 @@ Item {
     //       recommended to do only relative adjustments.
     property color borderColor: "black"
     property int borderWidth: 0
-    readonly property int effectiveBorderWidth: shaderEffect.readyForVisibility ? borderWidth : 0
+    readonly property int effectiveBorderWidth: shaderEffect.visible ? borderWidth : 0
 
     // NOTE: Note the distinction between ShaderEffect and
     //       ShaderEffectSource. ShaderEffect is no different
@@ -154,15 +154,13 @@ Item {
         width: paintedSize.width
         height: paintedSize.height
 
-        visible: readyForVisibility
-
-        readonly property bool readyForVisibility: (source.status === Image.Ready) &&
-                                                   (GraphicsInfo.shaderType === GraphicsInfo.RhiShader) &&
-                                                   (root.radius > 0.0 ||
-                                                    root.borderWidth > 0 ||
-                                                    backgroundColor.a > 0.0 ||
-                                                    source !== image ||
-                                                    root.fillMode === Image.PreserveAspectCrop)
+        visible: (source.status === Image.Ready) &&
+                 (GraphicsInfo.shaderType === GraphicsInfo.RhiShader) &&
+                 (root.radius > 0.0 ||
+                  root.borderWidth > 0 ||
+                  backgroundColor.a > 0.0 ||
+                  source !== image ||
+                  root.fillMode === Image.PreserveAspectCrop)
 
         smooth: root.smooth
 
@@ -284,7 +282,7 @@ Item {
         // because the root item may be invisible (`grabToImage()` call on an invisible
         // item case). In that case, shader effect would report invisible although it
         // would appear in the grabbed image.
-        visible: (status === Image.Ready) && !shaderEffect.readyForVisibility
+        visible: (status === Image.Ready) && !shaderEffect.visible
 
         // Clipping is not a big concern for rendering performance
         // with the software or openvg scene graph adaptations.



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f575a4d79e86948e2024151f83fbbf82e6c165a2...1269a691be7ac857e204762b495293d8c78d1948

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f575a4d79e86948e2024151f83fbbf82e6c165a2...1269a691be7ac857e204762b495293d8c78d1948
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