Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
02a370ef by Fatih Uzunoglu at 2026-01-22T21:20:13+00:00
Revert "qml: let `grabToImage()` do the off-screen rendering in DragItem"

This reverts commit 54f953b3a0d6e8194dbebe0c518c970520248e05.

Without setting visibility, asynchronous loading of images does not work.
This is considered a Qt bug. This change should not have a performance
impact, because `grabToImage()` already does the same. Qt is expected
to use the same layer that is created when visibility is set, instead
of creating a new one.

- - - - -
76933452 by Fatih Uzunoglu at 2026-01-22T21:20:13+00:00
qml: asynchronous load images in drag item when applicable

This only matters when the source is not a texture provider,
that is when drag item loads the images and generates the
textures itself, the default case is reusing textures
which is sourced from delegate instances.

Thanks to 699d2a01, we can enable asynchronous loading now.
This should prevent freezing the UI for few milliseconds
if images need to be loaded.

- - - - -


1 changed file:

- modules/gui/qt/widgets/qml/DragItem.qml


Changes:

=====================================
modules/gui/qt/widgets/qml/DragItem.qml
=====================================
@@ -153,6 +153,10 @@ Item {
 
     enabled: false
 
+    // Offscreen render:
+    layer.enabled: true
+    layer.effect: Item { }
+
     function _setData(data) {
         console.assert(data.length === indexes.length)
         _data = data
@@ -219,7 +223,11 @@ Item {
 
         const requestId = ++dragItem._grabImageRequest
 
+        visible = true
+
         const s = dragItem.grabToImage(function (result) {
+            visible = false
+
             if (requestId !== dragItem._grabImageRequest
                     || fsmDragInactive.active)
                 return
@@ -507,8 +515,8 @@ Item {
                 borderColor: theme.border
                 fillMode: Image.PreserveAspectCrop
 
-                // FIXME: Qt bug, asynchronous + texture provider + custom 
shader does not work properly with `grabToImage()`:
-                asynchronous: false
+                // WARNING: Setting asynchronous may require setting 
visibility (Qt bug).
+                asynchronous: true
 
                 readonly property real eDPR: 
MainCtx.effectiveDevicePixelRatio(Window.window)
                 property bool _triggerReadiness: false



View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/662b4bad7b46149eae620ced005a092d9b5456f8...76933452612934d3a1bb84bc491ea8db2026de63

-- 
View it on GitLab: 
https://code.videolan.org/videolan/vlc/-/compare/662b4bad7b46149eae620ced005a092d9b5456f8...76933452612934d3a1bb84bc491ea8db2026de63
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

Reply via email to