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

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



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: Providing the stride explicitly this is what I get:

Diff Detail

Automatic diff as part of commit; lint not applicable.
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:

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.