Avoid deep copy of image data when getting pixmaps in SNIs
ClosedPublic

Authored by davidedmundson on Apr 30 2017, 4:33 PM.

Details

Summary

We get the data as a QByteArray we can just ref the original data,
rather than doing a deep copy of the data.

Might save a few cycles when we have an SNI animating.

Test Plan

Ran an app that I know uses xembedsniproxy which always sends data as an image
Still had an icon in the system tray as before

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson created this revision.Apr 30 2017, 4:33 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 30 2017, 4:33 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
markg accepted this revision.Apr 30 2017, 11:41 PM
markg added a subscriber: markg.
markg added inline comments.
dataengines/statusnotifieritem/statusnotifieritemsource.cpp
393–399

Unrelated to your commit, i know.

Is there a reason why this is done at runtime?

#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
// convert.. with qFromLittleEndian for instance
#endif

Just curious.

409

Very smart! I didn't even know that was possible.
The cast should change to a C++ style cast though.

This revision is now accepted and ready to land.Apr 30 2017, 11:41 PM
This revision was automatically updated to reflect the committed changes.