mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Addresses issues raised in #24465; removes redundancy in set_bitmap_dimensions
Removed passing test .ini files and moved euclid extensions to euclidext.rs to factor out redundant code
This commit is contained in:
parent
f7fb130a2a
commit
ec2961920b
32 changed files with 211 additions and 131 deletions
|
@ -169,8 +169,8 @@ impl ImageData {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn get_rect(&self, rect: Rect<u32>) -> Cow<[u8]> {
|
||||
pixels::rgba8_get_rect(self.as_slice(), self.get_size(), rect)
|
||||
pub unsafe fn get_rect(&self, rect: Rect<u64>) -> Cow<[u8]> {
|
||||
pixels::rgba8_get_rect(self.as_slice(), self.get_size().to_u64(), rect)
|
||||
}
|
||||
|
||||
pub fn get_size(&self) -> Size2D<u32> {
|
||||
|
@ -194,3 +194,13 @@ impl ImageDataMethods for ImageData {
|
|||
NonNull::new(self.data.get()).expect("got a null pointer")
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Size2DExt {
|
||||
fn to_u64(&self) -> Size2D<u64>;
|
||||
}
|
||||
|
||||
impl Size2DExt for Size2D<u32> {
|
||||
fn to_u64(&self) -> Size2D<u64> {
|
||||
return Size2D::new(self.width as u64, self.height as u64);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue