pixels: Actually write pixels in MULTIPLY generic_transform_inplace operations#36895
pixels: Actually write pixels in MULTIPLY generic_transform_inplace operations#36895sagudev merged 1 commit intoservo:mainfrom
MULTIPLY generic_transform_inplace operations#36895Conversation
|
@sagudev < Please take a look. cc @xiaochengh |
mrobinson
left a comment
There was a problem hiding this comment.
Does this fix a particular issue? It's not discussed in the PR description (which is also using the old message template) nor is there any test included. Please either include a test or describe why one isn't required.
| @@ -64,10 +64,16 @@ pub fn rgba8_byte_swap_colors_inplace(pixels: &mut [u8]) { | |||
| pub fn rgba8_byte_swap_and_premultiply_inplace(pixels: &mut [u8]) { | |||
There was a problem hiding this comment.
We should replace this function with generic_transform_inplace::<1, true, false>(pixels) anyway.
There was a problem hiding this comment.
Replace it inside this PR?
There was a problem hiding this comment.
Hm, lets make it in this PR, this way we ensure that other changes are better tested.
There are no actual working WPT/manual test to verify with CI. Currently I am working on createImageBitmap() API and on the following WPT test this change are fixing incorrect behaviour (html/canvas/element/manual/imagebitmap/createImageBitmap-premultiplyAlpha.html). I split this change from main draft PR to merge it before (may be someone will meet with it also). So please recommend that is the proper way:
|
406d696 to
039333c
Compare
Why? I think this does not change results so it's only premature optimization (or do we have benches that shows otherwise). |
Really? I think some webgl/2d or maybe even webgpu should catch this. It is also possible that they are masked by other failures. |
Yes, it is optimization (results before and after will be the same, so no point to do multiply at all). |
I think this should be part of separate PR, let's keep this about fixing current impl. We also have some existing benches for pixels crate, but its hard to make representative benches. Also note that branchless is sometimes more performant even if doing more work. |
039333c to
457a88d
Compare
|
@sagudev @mrobinson < I rewrited PR message and remove all changes related to code cleanup and alpha multiply optimization (they will be done in another PRs) |
|
🔨 Triggering try run (#14888835620) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14888835620): Flaky unexpected result (13)
Stable unexpected results that are known to be intermittent (18)
Stable unexpected results (1)
|
|
|
Just as I though, this is actually tested 🎉so it needs updated expectations. But otherwise LGTM. |
The RGB components of pixel wasn't overwritten after alpha multiply operation. Testing: /webgl/tests/conformance/context/premultiplyalpha-test.html Fixes: servo#35759 Signed-off-by: Andrei Volykhin <[email protected]>
457a88d to
0deb401
Compare
MULTIPLY generic_transform_inplace operations
Multiply operations applied in
generic_transform_inplacewerecalculating the new pixel values, but not actually writing them.
This changes fixes that issue.
Testing: /webgl/tests/conformance/context/premultiplyalpha-test.html
Fixes: #35759