aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-09-09 12:10:12 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2018-09-09 12:21:56 +0200
commitd8b7394fa30829e20b6aa964045869dc4cf87179 (patch)
treea5aa22c2f8ab376ae1b19eeb9345568689e1b0e8 /components/script/dom
parentf726f182918028844cb240de48dbad7aa8c30667 (diff)
downloadservo-d8b7394fa30829e20b6aa964045869dc4cf87179.tar.gz
servo-d8b7394fa30829e20b6aa964045869dc4cf87179.zip
Fix the UNSIGNED_SHORT_5_5_5_1 case of premultiply_pixels
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/webglrenderingcontext.rs5
1 files changed, 3 insertions, 2 deletions
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) => {