[vlc-commits] [Git][videolan/vlc][master] qml: improve batch rendering of GridView

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Jul 21 14:05:36 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
2395eb29 by Pierre Lamot at 2022-07-21T13:17:20+00:00
qml: improve batch rendering of GridView

Items in the grid view overlaps each other due to their shadow effect, by
grouping them every even index (vertically and horizontally), we can ensure that
items with the same Z index won't overlaps. This allows items of the same group
to be batch rendered by the engine.

- - - - -


1 changed file:

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


Changes:

=====================================
modules/gui/qt/widgets/qml/ExpandGridView.qml
=====================================
@@ -455,6 +455,11 @@ FocusScope {
         return i >= 0 && i < childrenList.length && typeof childrenList[i] !== "undefined"
     }
 
+    function _indexToZ(id) {
+        var rowCol = getItemRowCol(id)
+        return rowCol[0] % 2 + 2 * (rowCol[1] % 2)
+    }
+
     function _repositionItem(id, x, y) {
         var item = _getItem(id)
         console.assert(item !== undefined, "wrong child: " + id)
@@ -462,6 +467,7 @@ FocusScope {
         //theses properties are always defined in Item
         item.x = x
         item.y = y
+        item.z = _indexToZ(id)
         item.selected = selectionDelegateModel.isSelected(model.index(id, 0))
 
         return item
@@ -476,6 +482,7 @@ FocusScope {
         item.selected = selectionDelegateModel.isSelected(model.index(id, 0))
         item.x = x
         item.y = y
+        item.z = _indexToZ(id)
         item.visible = true
 
         _setItem(id, item)
@@ -490,6 +497,7 @@ FocusScope {
                         model: model.getDataAt(id),
                         x: x,
                         y: y,
+                        z: _indexToZ(id),
                         visible: true
                     })
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2395eb294e21703cb82a3a926b00cca6367de97c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/2395eb294e21703cb82a3a926b00cca6367de97c
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