D5670: Avoid deep copy of image data when getting pixmaps in SNIs

Mark Gaiser noreply at phabricator.kde.org
Sun Apr 30 23:41:14 UTC 2017


markg accepted this revision.
markg added inline comments.
This revision is now accepted and ready to land.

INLINE COMMENTS

> statusnotifieritemsource.cpp:393-399
>      if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
>          uint *uintBuf = (uint *) image.data.data();
>          for (uint i = 0; i < image.data.size()/sizeof(uint); ++i) {
>              *uintBuf = ntohl(*uintBuf);
>              ++uintBuf;
>          }
>      }

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.

> statusnotifieritemsource.cpp:409
> +
> +    QImage iconImage((const uchar*)dataRef->data(), image.width, image.height, QImage::Format_ARGB32,
> +            [](void* ptr) {

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

REPOSITORY
  R120 Plasma Workspace

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D5670

To: davidedmundson, #plasma, markg
Cc: markg, plasma-devel, spstarr, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170430/aa915244/attachment.html>


More information about the Plasma-devel mailing list