[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml: don't cache Player image

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Fri May 13 08:34:32 UTC 2022



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


Commits:
1f59a7c1 by Fatih Uzunoglu at 2022-05-13T08:00:56+00:00
qml: don't cache Player image

- - - - -
7a66d9c3 by Fatih Uzunoglu at 2022-05-13T08:00:56+00:00
qml: asynchronously load various content images

- - - - -
dd732081 by Fatih Uzunoglu at 2022-05-13T08:00:56+00:00
qml: don't cache DragItem image

- - - - -
c2d91aab by Fatih Uzunoglu at 2022-05-13T08:00:56+00:00
qml: limit Player image source size

- - - - -


4 changed files:

- modules/gui/qt/player/qml/Player.qml
- modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
- modules/gui/qt/playlist/qml/PlaylistDelegate.qml
- modules/gui/qt/widgets/qml/DragItem.qml


Changes:

=====================================
modules/gui/qt/player/qml/Player.qml
=====================================
@@ -423,25 +423,37 @@ FocusScope {
             visible: !rootPlayer.hasEmbededVideo
 
             Item {
-                Layout.preferredHeight: rootPlayer.height / 2.7182
-                Layout.preferredWidth: height * cover.sar
+                Layout.preferredHeight: rootPlayer.height / heightConstant
+                Layout.preferredWidth: cover.paintedWidth
                 Layout.maximumHeight: centerContent.height
                 Layout.alignment: Qt.AlignHCenter
 
+                readonly property real heightConstant: 2.7182
+
                 Image {
                     id: cover
 
                     //source aspect ratio
-                    readonly property real sar: cover.sourceSize.width / cover.sourceSize.height
+                    readonly property real sar: paintedWidth / paintedHeight
 
-                    anchors.fill: parent
+                    anchors.top: parent.top
+                    anchors.bottom: parent.bottom
+                    anchors.horizontalCenter: parent.horizontalCenter
                     source: rootPlayer.coverSource
                     fillMode: Image.PreserveAspectFit
-                    mipmap: height < sourceSize.height * .3
+                    mipmap: true
+                    cache: false
+                    asynchronous: true
+                    sourceSize: Qt.size(maximumWidth, maximumHeight)
+
+                    readonly property real maximumWidth: MainCtx.screen ? (MainCtx.screen.availableVirtualSize.width * MainCtx.screen.devicePixelRatio)
+                                                                        : 1024
+                    readonly property real maximumHeight: MainCtx.screen ? (MainCtx.screen.availableVirtualSize.height * MainCtx.screen.devicePixelRatio / parent.heightConstant)
+                                                                         : 1024
                 }
 
                 Widgets.CoverShadow {
-                    anchors.fill: cover
+                    anchors.fill: parent
                     source: cover
                     primaryVerticalOffset: VLCStyle.dp(24)
                     primaryRadius: VLCStyle.dp(54)


=====================================
modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
=====================================
@@ -106,6 +106,8 @@ AbstractButton {
 
                 mipmap: true
 
+                asynchronous: true
+
                 ToolTip.visible: infoColumn.width < infoColumn.implicitWidth
                                  && (artworkInfoItem.hovered || artworkInfoItem.visualFocus)
                 ToolTip.delay: VLCStyle.delayToolTipAppear


=====================================
modules/gui/qt/playlist/qml/PlaylistDelegate.qml
=====================================
@@ -127,6 +127,7 @@ T.Control {
                 fillMode: Image.PreserveAspectFit
                 source: (model.artwork && model.artwork.toString()) ? model.artwork : VLCStyle.noArtAlbumCover
                 visible: !statusIcon.visible
+                asynchronous: true
             }
 
             Widgets.IconLabel {


=====================================
modules/gui/qt/widgets/qml/DragItem.qml
=====================================
@@ -352,6 +352,8 @@ Item {
             fillMode: Image.PreserveAspectCrop
             width: coverSize
             height: coverSize
+            asynchronous: true
+            cache: false
         }
     }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1f9699c67e292bf0242126b0e5bccdc17b95e06b...c2d91aabff60d36da34c125ca42005395e70b327

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1f9699c67e292bf0242126b0e5bccdc17b95e06b...c2d91aabff60d36da34c125ca42005395e70b327
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