SvgItem, IconItem: drop "smooth" property override, update node on change
ClosedPublic

Authored by kossebau on Apr 13 2019, 3:28 PM.

Details

Summary

QQuickItem already has a "smooth" property, which was shadowed by the
custom ones with the same name. As the property was not part of public
symbols, but instead is dynamically looked up without the class name part
of the property, we just remove the custom versions and instead switch
all custom code to use the inherited property.

While doing that the code is also fixed to properly update the
textureNodes to the current value of the "smooth" property.
As well as not set the filtering only on the texture, when it is passed
to a texturenode which will set its own filtering state to the texture
right before the bind call and thus wipe any previous direct setting
of the filter mode on the texture.

This also changed the default to smooth=true for SvgItem, though
effectively smooth was always true, as the texturenode was hardcoded
to get a QSGTexture::Linear filtering (which, as said above, is forced
onto its texture, no matter what was otherwise set before).

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Apr 13 2019, 3:28 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 13 2019, 3:28 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
kossebau requested review of this revision.Apr 13 2019, 3:28 PM
kossebau added inline comments.Apr 13 2019, 3:31 PM
src/declarativeimports/core/iconitem.h
72

Actually unsure about whether we can remove this, other than claimed in prepared commit message :)
But from what I saw in the code, this should be possible, as the name of the actual class which injects a property is nowhere stored/used on accessing the property, also saw no issues while test running this change.

A good example to see how the smooth property was broken is the animation of the analog clock's hands (best enable second hand to see often):
the Hand.qml has "smooth: !anim.running" set as property for the SvgItem. Without this patch, the hand during animation looks fine. With this patch, the hand looks very unsmooth during animation.

As aftermath I would actually do a patch to change this to "smooth: true", given it looks quite bad and no-one before complained about resource issues, so this once intended optimization seems unneeded now.

davidedmundson accepted this revision.Apr 14 2019, 5:38 PM
This revision is now accepted and ready to land.Apr 14 2019, 5:38 PM
This revision was automatically updated to reflect the committed changes.