mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Merge some byte swap/premultiply functions in their own crate
This commit is contained in:
parent
a2e3dd4e86
commit
784fbb2bc1
18 changed files with 85 additions and 96 deletions
|
@ -7,6 +7,7 @@ use canvas_data::*;
|
|||
use canvas_traits::canvas::*;
|
||||
use euclid::Size2D;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use pixels;
|
||||
use std::borrow::ToOwned;
|
||||
use std::collections::HashMap;
|
||||
use std::thread;
|
||||
|
@ -141,7 +142,7 @@ impl<'a> CanvasPaintThread <'a> {
|
|||
let data = match imagedata {
|
||||
None => vec![0; image_size.width as usize * image_size.height as usize * 4],
|
||||
Some(mut data) => {
|
||||
byte_swap(&mut data);
|
||||
pixels::byte_swap_colors_inplace(&mut data);
|
||||
data.into()
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue