Treat input RGB buffers as premultiplied
ClosedPublic

Authored by davidedmundson on Aug 22 2017, 9:20 AM.

Details

Summary

Currently the server treats incoming buffers as not premultiplied.

KWayland::Client sends data that is ARGB32 and ARGB32_Premultiplied as the same
WL_SHM_FORMAT_ARGB8888.

According to a post on wayland-devel by Fredrik Höglund, all RGB data
should be treated as premultiplied, which matches what Qt is doing.

I've changed client to perform a conversion rather than sending
mismatched data, but this commit will still breaks a bunch of tests in
the stable kwin branch as it compares the server output to a fixed
QImage with a format.

Test Plan

Existing tests pass

Modified surface test to check the pixel data relative to the output QImage format
not the input format (i.e both input from ARGB32 and ARGB32_Premultiplied) should
both end up in a QImage with format Premultiplied with premultiplied values.

The existing test was confirming that data was corrupted, checking that even though
the output format was not pre-multiplied, the data was.

Diff Detail

Repository
R127 KWayland
Branch
mart/xdgforeign
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson created this revision.Aug 22 2017, 9:20 AM
Restricted Application added projects: Plasma on Wayland, Frameworks. · View Herald TranscriptAug 22 2017, 9:20 AM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
graesslin accepted this revision.Aug 22 2017, 3:05 PM
This revision is now accepted and ready to land.Aug 22 2017, 3:05 PM
This revision was automatically updated to reflect the committed changes.