mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Stop using int/uint in net_traits.
This commit is contained in:
parent
f22d920b4d
commit
b50b21d1da
5 changed files with 17 additions and 13 deletions
|
@ -47,7 +47,7 @@ pub fn load_from_memory(buffer: &[u8]) -> Option<Image> {
|
|||
} else {
|
||||
// For non-png images, we use stb_image
|
||||
// Can't remember why we do this. Maybe it's what cairo wants
|
||||
static FORCE_DEPTH: uint = 4;
|
||||
static FORCE_DEPTH: usize = 4;
|
||||
|
||||
match stb_image2::load_from_memory_with_depth(buffer, FORCE_DEPTH, true) {
|
||||
stb_image2::LoadResult::ImageU8(mut image) => {
|
||||
|
|
|
@ -20,7 +20,7 @@ use url::Url;
|
|||
pub struct ImageHolder<NodeAddress> {
|
||||
url: Url,
|
||||
image: Option<Arc<Box<Image>>>,
|
||||
cached_size: Size2D<int>,
|
||||
cached_size: Size2D<u32>,
|
||||
local_image_cache: Arc<Mutex<LocalImageCache<NodeAddress>>>,
|
||||
}
|
||||
|
||||
|
@ -55,16 +55,15 @@ impl<NodeAddress: Send + 'static> ImageHolder<NodeAddress> {
|
|||
///
|
||||
/// The intent is that the impure version is used during layout when dimensions are used for
|
||||
/// computing layout.
|
||||
pub fn size(&self) -> Size2D<int> {
|
||||
pub fn size(&self) -> Size2D<u32> {
|
||||
self.cached_size
|
||||
}
|
||||
|
||||
/// Query and update the current image size.
|
||||
pub fn get_size(&mut self, node_address: NodeAddress) -> Option<Size2D<int>> {
|
||||
pub fn get_size(&mut self, node_address: NodeAddress) -> Option<Size2D<u32>> {
|
||||
debug!("get_size() {}", self.url.serialize());
|
||||
self.get_image(node_address).map(|img| {
|
||||
self.cached_size = Size2D(img.width as int,
|
||||
img.height as int);
|
||||
self.cached_size = Size2D(img.width, img.height);
|
||||
self.cached_size.clone()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue