mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Prefix some pixels functions with rgba8_
This commit is contained in:
parent
adf363a208
commit
a5779ad372
9 changed files with 15 additions and 15 deletions
|
@ -403,7 +403,7 @@ impl CanvasRenderingContext2D {
|
|||
) -> ErrorResult {
|
||||
debug!("Fetching image {}.", url);
|
||||
let (mut image_data, image_size) = self.fetch_image_data(url).ok_or(Error::InvalidState)?;
|
||||
pixels::premultiply_inplace(&mut image_data);
|
||||
pixels::rgba8_premultiply_inplace(&mut image_data);
|
||||
let image_size = image_size.to_f64();
|
||||
|
||||
let dw = dw.unwrap_or(image_size.width);
|
||||
|
|
|
@ -162,7 +162,7 @@ impl ImageData {
|
|||
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn get_rect(&self, rect: Rect<u32>) -> Cow<[u8]> {
|
||||
pixels::get_rect(self.as_slice(), self.get_size(), rect)
|
||||
pixels::rgba8_get_rect(self.as_slice(), self.get_size(), rect)
|
||||
}
|
||||
|
||||
pub fn get_size(&self) -> Size2D<u32> {
|
||||
|
|
|
@ -559,7 +559,7 @@ impl WebGLRenderingContext {
|
|||
_ => unimplemented!(),
|
||||
};
|
||||
|
||||
pixels::byte_swap_colors_inplace(&mut data);
|
||||
pixels::rgba8_byte_swap_colors_inplace(&mut data);
|
||||
|
||||
TexPixels::new(data, size, false)
|
||||
},
|
||||
|
@ -572,7 +572,7 @@ impl WebGLRenderingContext {
|
|||
}
|
||||
if let Some((mut data, size)) = canvas.fetch_all_data() {
|
||||
// Pixels got from Canvas have already alpha premultiplied
|
||||
pixels::byte_swap_colors_inplace(&mut data);
|
||||
pixels::rgba8_byte_swap_colors_inplace(&mut data);
|
||||
TexPixels::new(data, size, true)
|
||||
} else {
|
||||
return Ok(None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue