diff --git a/Cargo.toml b/Cargo.toml index 222967b..69ad61b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,13 +3,13 @@ name = "io-surface" description = "Bindings to IO Surface for OS X" homepage = "https://github.com/servo/io-surface-rs" repository = "https://github.com/servo/io-surface-rs" -version = "0.1.1" +version = "0.1.2" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" [dependencies] libc = "0.2" -gleam = "0.1" +gleam = "0.2" euclid = "0.4" [target.x86_64-apple-darwin.dependencies] diff --git a/src/lib.rs b/src/lib.rs index a578d4d..14a64f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,8 +10,7 @@ #![crate_name = "io_surface"] #![crate_type = "rlib"] -#![feature(core)] -#![feature(slice_bytes)] +#![feature(clone_from_slice)] extern crate libc; extern crate core_foundation; @@ -29,7 +28,6 @@ use cgl::{kCGLNoError, CGLGetCurrentContext, CGLTexImageIOSurface2D}; use gleam::gl::{BGRA, GLenum, RGBA, TEXTURE_RECTANGLE_ARB, UNSIGNED_INT_8_8_8_8_REV}; use libc::{c_int, c_void, size_t}; use std::mem; -use std::slice::bytes::copy_memory; use std::slice; @@ -153,7 +151,7 @@ impl IOSurface { let size = (height * stride) as usize; let address = IOSurfaceGetBaseAddress(surface) as *mut u8; let dest: &mut [u8] = slice::from_raw_parts_mut(address, size); - copy_memory(data, dest); + dest.clone_from_slice(data); // FIXME(pcwalton): RAII IOSurfaceUnlock(surface, 0, &mut seed);