From bc9f55bcc9df08620d81c5c9e31e3a563be08428 Mon Sep 17 00:00:00 2001 From: Andrei Volykhin Date: Thu, 8 May 2025 10:38:02 +0300 Subject: [PATCH] pixels: Actually write pixels in `MULTIPLY` `generic_transform_inplace` operations (#36895) Multiply operations applied in `generic_transform_inplace` were calculating the new pixel values, but not actually writing them. This changes fixes that issue. Testing: /webgl/tests/conformance/context/premultiplyalpha-test.html Fixes: #35759 Signed-off-by: Andrei Volykhin --- components/pixels/lib.rs | 7 ++++--- .../conformance/context/premultiplyalpha-test.html.ini | 8 -------- 2 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 tests/wpt/webgl/meta/conformance/context/premultiplyalpha-test.html.ini diff --git a/components/pixels/lib.rs b/components/pixels/lib.rs index 24386ff830a..c1f57875c6d 100644 --- a/components/pixels/lib.rs +++ b/components/pixels/lib.rs @@ -294,9 +294,10 @@ pub fn generic_transform_inplace< match MULTIPLY { 1 => { let a = rgba[3]; - multiply_u8_color(rgba[0], a); - multiply_u8_color(rgba[1], a); - multiply_u8_color(rgba[2], a); + + rgba[0] = multiply_u8_color(rgba[0], a); + rgba[1] = multiply_u8_color(rgba[1], a); + rgba[2] = multiply_u8_color(rgba[2], a); }, 2 => { let a = rgba[3] as u32; diff --git a/tests/wpt/webgl/meta/conformance/context/premultiplyalpha-test.html.ini b/tests/wpt/webgl/meta/conformance/context/premultiplyalpha-test.html.ini deleted file mode 100644 index ffc971bc861..00000000000 --- a/tests/wpt/webgl/meta/conformance/context/premultiplyalpha-test.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[premultiplyalpha-test.html] - bug: https://github.com/servo/servo/issues/21132 - - [WebGL test #62] - expected: FAIL - - [WebGL test #69] - expected: FAIL