diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2018-10-06 00:05:04 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2018-10-06 00:05:04 +0200 |
commit | a2e3dd4e8636b7125140850dc4bc95433e801e77 (patch) | |
tree | 545ab9ab802e206d099f3e4944424c70dd7e2349 | |
parent | 82c7d71811c072a29fb73df49664490dcba2d82f (diff) | |
download | servo-a2e3dd4e8636b7125140850dc4bc95433e801e77.tar.gz servo-a2e3dd4e8636b7125140850dc4bc95433e801e77.zip |
Rename byte_swap_and_premultiply to byte_swap_colors_inplace
The function did not actually premultiply.
-rw-r--r-- | components/net_traits/image/base.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/net_traits/image/base.rs b/components/net_traits/image/base.rs index 40b4d5d3c47..35b52e559fe 100644 --- a/components/net_traits/image/base.rs +++ b/components/net_traits/image/base.rs @@ -47,7 +47,7 @@ pub struct ImageMetadata { // reference count them. // TODO(pcwalton): Speed up with SIMD, or better yet, find some way to not do this. -fn byte_swap_and_premultiply(data: &mut [u8]) { +fn byte_swap_colors_inplace(data: &mut [u8]) { let length = data.len(); let mut i = 0; @@ -82,7 +82,7 @@ pub fn load_from_memory(buffer: &[u8]) -> Option<Image> { DynamicImage::ImageRgba8(rgba) => rgba, image => image.to_rgba(), }; - byte_swap_and_premultiply(&mut *rgba); + byte_swap_colors_inplace(&mut *rgba); Some(Image { width: rgba.width(), height: rgba.height(), |