Commit 4665d0b4 authored by Nate Graham's avatar Nate Graham 🔩

[Media Frame] Set sourceSize for higher quality and lower memory consumption

Summary: Without this, diagonal lines are aliased and many images look terrible.

Test Plan:
Before: {F6660129, size=full}

After: {F6660131, size=full}

Slideshow transitions still work.

Performance still seems good in a crappy VM with 2 GB RAM and software rendering only.

Reviewers: #plasma, broulik, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: anthonyfieroni, broulik, davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19550
parent a870e674
......@@ -180,6 +180,18 @@ Item {
visible: hasItems
anchors.fill: parent
// This timer prevents reloading the image too often when resizing,
// to minimize excessively re-reading the file on disk
Timer {
id: imageReloadTimer
interval: 250
running: false
onTriggered: {
frontImage.sourceSize.width = width
frontImage.sourceSize.height = height
}
}
Image {
id: bufferImage
......@@ -208,6 +220,12 @@ Item {
asynchronous: true
autoTransform: true
onWidthChanged: imageReloadTimer.restart()
onHeightChanged: imageReloadTimer.restart()
sourceSize.width: width
sourceSize.height: height
MouseArea {
anchors.fill: parent
onClicked: Qt.openUrlExternally(activeSource)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment