diff --git a/src/components/gfx/render_context.rs b/src/components/gfx/render_context.rs index 943bb0bc876..2e6b7c15260 100644 --- a/src/components/gfx/render_context.rs +++ b/src/components/gfx/render_context.rs @@ -105,7 +105,7 @@ impl<'a> RenderContext<'a> { self.draw_target.make_current(); let draw_target_ref = &self.draw_target; - let azure_surface = draw_target_ref.create_source_surface_from_data(image.pixels, size, + let azure_surface = draw_target_ref.create_source_surface_from_data(image.pixels.as_slice(), size, stride as i32, B8G8R8A8); let source_rect = Rect(Point2D(0 as AzFloat, 0 as AzFloat), Size2D(image.width as AzFloat, image.height as AzFloat)); diff --git a/src/components/net/image/base.rs b/src/components/net/image/base.rs index 9f9589551b3..b01c0b7ec20 100644 --- a/src/components/net/image/base.rs +++ b/src/components/net/image/base.rs @@ -10,7 +10,7 @@ use png; // reference count them. pub type Image = png::Image; -pub fn Image(width: u32, height: u32, color_type: png::ColorType, data: ~[u8]) -> Image { +pub fn Image(width: u32, height: u32, color_type: png::ColorType, data: Vec) -> Image { png::Image { width: width, height: height, @@ -44,7 +44,7 @@ pub fn load_from_memory(buffer: &[u8]) -> Option { if png::is_png(buffer) { match png::load_png_from_memory(buffer) { Ok(mut png_image) => { - byte_swap(png_image.color_type, png_image.pixels); + byte_swap(png_image.color_type, png_image.pixels.as_mut_slice()); Some(png_image) } Err(_err) => None, @@ -57,7 +57,7 @@ pub fn load_from_memory(buffer: &[u8]) -> Option { match stb_image::load_from_memory_with_depth(buffer, FORCE_DEPTH, true) { stb_image::ImageU8(mut image) => { assert!(image.depth == 4); - byte_swap(png::RGBA8, image.data); + byte_swap(png::RGBA8, image.data.as_mut_slice()); Some(Image(image.width as u32, image.height as u32, png::RGBA8, image.data)) } stb_image::ImageF32(_image) => fail!("HDR images not implemented"), diff --git a/src/support/png/rust-png b/src/support/png/rust-png index fc6103e7670..8d75c64ac6b 160000 --- a/src/support/png/rust-png +++ b/src/support/png/rust-png @@ -1 +1 @@ -Subproject commit fc6103e7670222459ffd0b53ac9625d4bddb857c +Subproject commit 8d75c64ac6bc0b06d08e5c859dc792f771336064 diff --git a/src/support/stb-image/rust-stb-image b/src/support/stb-image/rust-stb-image index 7076b1b2c5d..d849f6de5ab 160000 --- a/src/support/stb-image/rust-stb-image +++ b/src/support/stb-image/rust-stb-image @@ -1 +1 @@ -Subproject commit 7076b1b2c5ddf08327dfb8b1232dc0b919685e68 +Subproject commit d849f6de5abfd601381826822094640df0e74a2a