diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 14888b4edfe..9f930361ee1 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -645,8 +645,9 @@ impl WebGLRenderingContext { }, (TexFormat::RGBA, TexDataType::UnsignedShort5551) => { for rgba in pixels.chunks_mut(2) { - let pix = NativeEndian::read_u16(rgba); - NativeEndian::write_u16(rgba, if pix & (1 << 15) != 0 { pix } else { 0 }); + if NativeEndian::read_u16(rgba) & 1 == 0 { + NativeEndian::write_u16(rgba, 0); + } } }, (TexFormat::RGBA, TexDataType::UnsignedShort4444) => { diff --git a/tests/wpt/webgl/meta/conformance/textures/misc/tex-image-with-format-and-type.html.ini b/tests/wpt/webgl/meta/conformance/textures/misc/tex-image-with-format-and-type.html.ini index aca89365106..cc7d66b3a16 100644 --- a/tests/wpt/webgl/meta/conformance/textures/misc/tex-image-with-format-and-type.html.ini +++ b/tests/wpt/webgl/meta/conformance/textures/misc/tex-image-with-format-and-type.html.ini @@ -2,12 +2,6 @@ [WebGL test #65: UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGBA/UNSIGNED_SHORT_4_4_4_4] expected: FAIL - [WebGL test #66: UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGBA/UNSIGNED_SHORT_5_5_5_1] - expected: FAIL - [WebGL test #69: UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGBA/UNSIGNED_SHORT_4_4_4_4] expected: FAIL - [WebGL test #70: UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGBA/UNSIGNED_SHORT_5_5_5_1] - expected: FAIL -