diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/Cargo.toml | 3 | ||||
-rw-r--r-- | components/script/dom/canvasrenderingcontext2d.rs | 12 | ||||
-rw-r--r-- | components/script/lib.rs | 1 |
3 files changed, 6 insertions, 10 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index d5ab8acd9fa..8fc3d56fa9b 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -48,9 +48,6 @@ git = "https://github.com/servo/rust-selectors" [dependencies.js] git = "https://github.com/servo/rust-mozjs" -[dependencies.png] -git = "https://github.com/servo/rust-png" - [dependencies.url] version = "0.2.33" features = ["query_encoding"] diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index af787682719..4d9ea26c6b7 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -35,7 +35,7 @@ use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending}; use canvas::canvas_paint_task::CanvasPaintTask; use net_traits::image_cache_task::{ImageCacheChan, ImageResponse}; -use png::PixelsByColorType; +use net_traits::image::base::PixelFormat; use num::{Float, ToPrimitive}; use std::borrow::ToOwned; @@ -286,11 +286,11 @@ impl CanvasRenderingContext2D { }; let image_size = Size2D::new(img.width as f64, img.height as f64); - let image_data = match img.pixels { - PixelsByColorType::RGBA8(ref pixels) => pixels.to_vec(), - PixelsByColorType::K8(_) => panic!("K8 color type not supported"), - PixelsByColorType::RGB8(_) => panic!("RGB8 color type not supported"), - PixelsByColorType::KA8(_) => panic!("KA8 color type not supported"), + let image_data = match img.format { + PixelFormat::RGBA8 => img.bytes.to_vec(), + PixelFormat::K8 => panic!("K8 color type not supported"), + PixelFormat::RGB8 => panic!("RGB8 color type not supported"), + PixelFormat::KA8 => panic!("KA8 color type not supported"), }; return Some((image_data, image_size)); diff --git a/components/script/lib.rs b/components/script/lib.rs index c1cdc1c02f6..6b3f5ce8c8f 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -48,7 +48,6 @@ extern crate libc; extern crate msg; extern crate net_traits; extern crate num; -extern crate png; extern crate rustc_serialize; extern crate time; extern crate canvas; |