From cbb6bbe4fd344a3015b9cb10f0fdc2a1d6e288e5 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Wed, 9 Dec 2015 10:05:18 -0500 Subject: [PATCH 1/3] Upgrade gleam: 0.1 -> 0.2 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 222967b..2bad04e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT / Apache-2.0" [dependencies] libc = "0.2" -gleam = "0.1" +gleam = "0.2" euclid = "0.4" [target.x86_64-apple-darwin.dependencies] From 617ab6120815fe61d677fe2f5c47d2021b1c28c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 13 Dec 2015 18:27:13 +0100 Subject: [PATCH 2/3] Bump version number too --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 2bad04e..69ad61b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ 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" From 0b49937bd014bfd9e109deef931fbc324c1fadd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 13 Dec 2015 18:38:23 +0100 Subject: [PATCH 3/3] Fix copy_memory error for latest nightly --- src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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);