Do not assume framebuffer and scalines are always 32-bit aligned
ClosedPublic

Authored by luc4 on Mar 30 2019, 1:57 PM.

Details

Summary

When server resolution is 1366x768 and 8-bit depth is requested, this is what I get:

Looking at the code, it seems that once QImage is initialized from framebuffer data, the used ctor expects the buffer and each scanline to be 32-bit aligned: https://doc.qt.io/Qt-5/qimage.html#QImage-3. Providing the stride explicitly this is what I get:

Diff Detail

Repository
R436 KRDC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
luc4 requested review of this revision.Mar 30 2019, 1:57 PM
luc4 created this revision.

Thanks. Looks good to me. Have you tested with all available color depths?

luc4 added a comment.EditedMar 31 2019, 12:26 PM

Yes, all three seem correct. I tested with a couple of resolutions. Server for the test was installed on a Raspberry Pi. It would be interesting to test also with other servers.

uwolfer accepted this revision.Apr 8 2019, 3:07 PM

Thanks for your work!

This issue might be related: https://bugs.kde.org/show_bug.cgi?id=406316

This revision is now accepted and ready to land.Apr 8 2019, 3:07 PM
luc4 added a comment.Apr 8 2019, 7:31 PM

Not sure if you already did, but I guess someone will also have to push this to git, sorry.

This revision was automatically updated to reflect the committed changes.