Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pixman/examples/alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
((10 * WIDTH) as u16, HEIGHT as u16),
((10 * WIDTH) as i32, HEIGHT as i32),
);

let src_img = src_img.set_alpha_map(&alpha_img, 10, 10);
Expand All @@ -76,7 +76,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
((10 * WIDTH) as u16, HEIGHT as u16),
((10 * WIDTH) as i32, HEIGHT as i32),
);

let mut out_img = Image::new(
Expand All @@ -93,7 +93,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(dest_img.width() as u16, dest_img.height() as u16),
(dest_img.width() as i32, dest_img.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down
8 changes: 4 additions & 4 deletions pixman/examples/checkerboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pub fn main() {
None,
(0, 0),
(0, 0),
((j * TILE_SIZE) as i16, (i * TILE_SIZE) as i16),
(TILE_SIZE as u16, TILE_SIZE as u16),
((j * TILE_SIZE) as i32, (i * TILE_SIZE) as i32),
(TILE_SIZE as i32, TILE_SIZE as i32),
);
}
}
Expand All @@ -54,7 +54,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(WIDTH as u16, HEIGHT as u16),
(WIDTH as i32, HEIGHT as i32),
);

let mut out_img = Image::new(
Expand All @@ -71,7 +71,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(destination.width() as u16, destination.height() as u16),
(destination.width() as i32, destination.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down
6 changes: 3 additions & 3 deletions pixman/examples/clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(WIDTH as u16, HEIGHT as u16),
(WIDTH as i32, HEIGHT as i32),
);

let clip_region = Region32::init_rect(50, 0, 100, 200);
Expand Down Expand Up @@ -67,7 +67,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(WIDTH as u16, HEIGHT as u16),
(WIDTH as i32, HEIGHT as i32),
);

let mut out_img = Image::new(
Expand All @@ -84,7 +84,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(dst_img.width() as u16, dst_img.height() as u16),
(dst_img.width() as i32, dst_img.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down
6 changes: 3 additions & 3 deletions pixman/examples/conical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn main() {
src_img.set_repeat(Repeat::Normal);
src_img.set_transform(transform).unwrap();

dest_img.composite32(
dest_img.composite(
Operation::Over,
&src_img,
None,
Expand All @@ -55,7 +55,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(dest_img.width() as u16, dest_img.height() as u16),
(dest_img.width() as i32, dest_img.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down Expand Up @@ -100,7 +100,7 @@ fn draw_checkerboard(image: &mut Image<'_, '_>, check_size: usize, color1: u32,
for i in 0..n_checks_x {
let src = if ((i ^ j) & 1) == 1 { &c1 } else { &c2 };

image.composite32(
image.composite(
Operation::Src,
src,
None,
Expand Down
4 changes: 2 additions & 2 deletions pixman/examples/gradient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
((10 * WIDTH) as u16, HEIGHT as u16),
((10 * WIDTH) as i32, HEIGHT as i32),
);

let mut out_img = Image::new(
Expand All @@ -60,7 +60,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(dest_img.width() as u16, dest_img.height() as u16),
(dest_img.width() as i32, dest_img.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down
2 changes: 1 addition & 1 deletion pixman/examples/solid_fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(dst.width() as u16, dst.height() as u16),
(dst.width() as i32, dst.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down
4 changes: 2 additions & 2 deletions pixman/examples/trap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(WIDTH as u16, HEIGHT as u16),
(WIDTH as i32, HEIGHT as i32),
);

let mut out_img = Image::new(
Expand All @@ -56,7 +56,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(dest_img.width() as u16, dest_img.height() as u16),
(dest_img.width() as i32, dest_img.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down
2 changes: 1 addition & 1 deletion pixman/examples/tri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub fn main() {
(0, 0),
(0, 0),
(0, 0),
(dest_img.width() as u16, dest_img.height() as u16),
(dest_img.width() as i32, dest_img.height() as i32),
);

let image_buffer = image::ImageBuffer::<image::Rgba<u8>, _>::from_raw(
Expand Down
36 changes: 0 additions & 36 deletions pixman/src/image/bits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,42 +266,6 @@ impl Image<'_, '_> {
/// Composite the specified src image into this image
#[allow(clippy::too_many_arguments)]
pub fn composite(
&mut self,
operation: Operation,
src: &ImageRef,
mask: Option<&ImageRef>,
src_loc: (i16, i16),
mask_loc: (i16, i16),
dest_loc: (i16, i16),
size: (u16, u16),
) {
let mask_ptr = if let Some(mask) = mask {
mask.as_ptr()
} else {
std::ptr::null_mut()
};

unsafe {
ffi::pixman_image_composite(
operation.into(),
src.as_ptr(),
mask_ptr,
self.as_ptr(),
src_loc.0,
src_loc.1,
mask_loc.0,
mask_loc.1,
dest_loc.0,
dest_loc.1,
size.0,
size.1,
)
}
}

/// Composite the specified src image into this image
#[allow(clippy::too_many_arguments)]
pub fn composite32(
&mut self,
operation: Operation,
src: &ImageRef,
Expand Down
Loading