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

Authored by ngraham on Mar 5 2019, 6:54 PM.

Details

Summary

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

Test Plan

Before:

After:

Slideshow transitions still work.

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

Diff Detail

Repository
R114 Plasma Addons
Branch
use-mipmapping-for-higher-quality (branched from Plasma/5.15)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9760
Build 9778: arc lint + arc unit
ngraham created this revision.Mar 5 2019, 6:54 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 5 2019, 6:54 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Mar 5 2019, 6:54 PM

Would it be better to set the sourceSize? If we're downscaling during rendering we're wasting memory

ngraham updated this revision to Diff 53249.Mar 5 2019, 10:58 PM

Set SourceSize instead of using mipmapping

Good call, that works too!

ngraham retitled this revision from [Media Frame] Use mipmapping for higher quality to [Media Frame] Set sourceSize for higher quality and lower memory consumption.Mar 5 2019, 10:59 PM
ngraham edited the summary of this revision. (Show Details)
broulik added a subscriber: broulik.Mar 6 2019, 3:22 PM
broulik added inline comments.
applets/mediaframe/package/contents/ui/main.qml
202

Note that this will cause the image to be reloaded everytime the size changes, so make sure the image isn't loaded repeatedly on start (as the applet is laid out) and/or while resizing the widget

ngraham updated this revision to Diff 53302.Mar 6 2019, 5:02 PM

Set sourceSize in a timer so we don't continuously reload the image while the widget is being resized

ngraham marked an inline comment as done.Mar 6 2019, 5:03 PM
ngraham added a reviewer: broulik.
anthonyfieroni added inline comments.
applets/mediaframe/package/contents/ui/main.qml
224–225

Maybe restart is better, you can resize more than a second, so it'll wait a timer interval with no resize activity. After that you can make timer.interval say 100 ms.

ngraham updated this revision to Diff 53310.Mar 6 2019, 7:37 PM
ngraham marked an inline comment as done.

Restart the timer when resizing is still ongoing so we can reduce the timer interval and update faster once resizing is done

applets/mediaframe/package/contents/ui/main.qml
183

Isn't this doing the opposite of the comment and /always/ reloading an image after 250ms with a new source size?

ngraham updated this revision to Diff 54155.Mar 17 2019, 10:55 PM
ngraham marked an inline comment as done.

Have the timer off by default so it only fires while resizing

ngraham updated this revision to Diff 54364.Mar 19 2019, 8:55 PM

Don't initially reload twice

davidedmundson accepted this revision.Mar 19 2019, 9:25 PM
This revision is now accepted and ready to land.Mar 19 2019, 9:25 PM
ngraham updated this revision to Diff 54370.Mar 19 2019, 9:32 PM

Improve comment

@d_ed told me to shipit!

This revision was automatically updated to reflect the committed changes.