From 35c18dfc03548cf2df59a70e6f19f52afa6ac030 Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Tue, 4 Mar 2014 08:43:17 -0800 Subject: [PATCH 1/5] Rust upgrade --- azure.rc | 16 ++++++++-------- azure_hl.rs | 18 +++++++++--------- scaled_font.rs | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/azure.rc b/azure.rc index c0d4285..70e9150 100644 --- a/azure.rc +++ b/azure.rc @@ -7,17 +7,17 @@ #[feature(globs)]; -extern mod std; -extern mod extra; -extern mod geom; -extern mod layers; -extern mod opengles; +extern crate std; +extern crate sync; +extern crate geom; +extern crate layers; +extern crate opengles; #[cfg(target_os = "linux")] -extern mod xlib; +extern crate xlib; #[cfg(target_os = "android")] -extern mod egl; +extern crate egl; #[cfg(not(target_os = "android"))] -extern mod glfw; +extern crate glfw = "glfw-rs"; pub use azure::*; diff --git a/azure_hl.rs b/azure_hl.rs index 881bb32..0bc869a 100644 --- a/azure_hl.rs +++ b/azure_hl.rs @@ -30,7 +30,7 @@ use azure::{AzSkiaSharedGLContextFlush, AzSkiaGrGLSharedSurfaceRef}; use azure::{AzCreatePathBuilder, AzPathBuilderRef, AzPathBuilderMoveTo, AzPathBuilderLineTo, AzPathBuilderFinish, AzReleasePathBuilder}; use azure::{AzDrawTargetFill, AzPathRef, AzReleasePath, AzDrawTargetPushClip, AzDrawTargetPopClip}; -use extra::arc::Arc; +use sync::Arc; use geom::matrix2d::Matrix2D; use geom::point::Point2D; use geom::rect::Rect; @@ -40,7 +40,7 @@ use std::libc::types::common::c99::{uint8_t, uint16_t}; use std::libc::size_t; use std::cast; use std::ptr; -use std::ptr::{null, to_unsafe_ptr}; +use std::ptr::null; use std::vec; #[cfg(target_os="linux")] @@ -452,7 +452,7 @@ impl DrawTarget { pub fn fill_rect(&self, rect: &Rect, pattern: &ColorPattern) { unsafe { AzDrawTargetFillRect(self.azure_draw_target, - to_unsafe_ptr(&rect.as_azure_rect()), + &rect.as_azure_rect(), pattern.azure_color_pattern); } } @@ -496,10 +496,10 @@ impl DrawTarget { unsafe { AzDrawTargetDrawSurface(self.azure_draw_target, surface.azure_source_surface, - to_unsafe_ptr(&dest.as_azure_rect()), - to_unsafe_ptr(&source.as_azure_rect()), - to_unsafe_ptr(&surf_options.as_azure_draw_surface_options()), - to_unsafe_ptr(&options.as_azure_draw_options())); + &dest.as_azure_rect(), + &source.as_azure_rect(), + &surf_options.as_azure_draw_surface_options(), + &options.as_azure_draw_options()); } } @@ -541,9 +541,9 @@ impl DrawTarget { unsafe { AzDrawTargetFillGlyphs(self.azure_draw_target, azfontref, - to_unsafe_ptr(&glyphbuf), + &glyphbuf, azure_pattern, - to_unsafe_ptr(&options), + &options, renderingOptions); } } diff --git a/scaled_font.rs b/scaled_font.rs index 78386a0..91a73c5 100644 --- a/scaled_font.rs +++ b/scaled_font.rs @@ -23,9 +23,9 @@ use scaled_font::android::*; #[cfg(target_os="macos")] pub mod macos { - extern mod core_foundation; - extern mod core_graphics; - extern mod core_text; + extern crate core_foundation; + extern crate core_graphics; + extern crate core_text; pub use scaled_font::macos::core_text::font::CTFontRef; pub use scaled_font::macos::core_graphics::font::{CGFont, CGFontRef}; @@ -33,14 +33,14 @@ pub mod macos { #[cfg(target_os="linux")] pub mod linux { - extern mod freetype; + extern crate freetype; pub use scaled_font::linux::freetype::freetype::{FT_Face, FT_LOAD_DEFAULT}; } #[cfg(target_os="android")] pub mod android { - extern mod freetype; + extern crate freetype; pub use scaled_font::android::freetype::freetype::{FT_Face, FT_LOAD_DEFAULT}; } From 792dc7d14d43d1b5e1500f1f3736975d5f396611 Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Thu, 13 Mar 2014 18:53:00 -0500 Subject: [PATCH 2/5] Rust upgrade --- scaled_font.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaled_font.rs b/scaled_font.rs index 91a73c5..6f6617b 100644 --- a/scaled_font.rs +++ b/scaled_font.rs @@ -84,7 +84,7 @@ impl ScaledFont { let options = AzCreateFontOptions((*native_font).family_name, style); azure_native_font.mType = AZ_NATIVE_FONT_SKIA_FONT_FACE; azure_native_font.mFont = cast::transmute(options); - let azure_native_font_ptr = ptr::to_unsafe_ptr(&azure_native_font); + let azure_native_font_ptr = &azure_native_font; let azure_scaled_font = AzCreateScaledFontForNativeFont(azure_native_font_ptr, size); AzDestroyFontOptions(options); ScaledFont { azure_scaled_font: azure_scaled_font } From 1bb266d0132137b3e7a22ce60e3c9294b2ce0371 Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Tue, 4 Mar 2014 08:43:17 -0800 Subject: [PATCH 3/5] Rust upgrade --- azure.rc | 16 ++++++++-------- azure_hl.rs | 18 +++++++++--------- scaled_font.rs | 10 +++++----- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/azure.rc b/azure.rc index c0d4285..70e9150 100644 --- a/azure.rc +++ b/azure.rc @@ -7,17 +7,17 @@ #[feature(globs)]; -extern mod std; -extern mod extra; -extern mod geom; -extern mod layers; -extern mod opengles; +extern crate std; +extern crate sync; +extern crate geom; +extern crate layers; +extern crate opengles; #[cfg(target_os = "linux")] -extern mod xlib; +extern crate xlib; #[cfg(target_os = "android")] -extern mod egl; +extern crate egl; #[cfg(not(target_os = "android"))] -extern mod glfw; +extern crate glfw = "glfw-rs"; pub use azure::*; diff --git a/azure_hl.rs b/azure_hl.rs index 881bb32..0bc869a 100644 --- a/azure_hl.rs +++ b/azure_hl.rs @@ -30,7 +30,7 @@ use azure::{AzSkiaSharedGLContextFlush, AzSkiaGrGLSharedSurfaceRef}; use azure::{AzCreatePathBuilder, AzPathBuilderRef, AzPathBuilderMoveTo, AzPathBuilderLineTo, AzPathBuilderFinish, AzReleasePathBuilder}; use azure::{AzDrawTargetFill, AzPathRef, AzReleasePath, AzDrawTargetPushClip, AzDrawTargetPopClip}; -use extra::arc::Arc; +use sync::Arc; use geom::matrix2d::Matrix2D; use geom::point::Point2D; use geom::rect::Rect; @@ -40,7 +40,7 @@ use std::libc::types::common::c99::{uint8_t, uint16_t}; use std::libc::size_t; use std::cast; use std::ptr; -use std::ptr::{null, to_unsafe_ptr}; +use std::ptr::null; use std::vec; #[cfg(target_os="linux")] @@ -452,7 +452,7 @@ impl DrawTarget { pub fn fill_rect(&self, rect: &Rect, pattern: &ColorPattern) { unsafe { AzDrawTargetFillRect(self.azure_draw_target, - to_unsafe_ptr(&rect.as_azure_rect()), + &rect.as_azure_rect(), pattern.azure_color_pattern); } } @@ -496,10 +496,10 @@ impl DrawTarget { unsafe { AzDrawTargetDrawSurface(self.azure_draw_target, surface.azure_source_surface, - to_unsafe_ptr(&dest.as_azure_rect()), - to_unsafe_ptr(&source.as_azure_rect()), - to_unsafe_ptr(&surf_options.as_azure_draw_surface_options()), - to_unsafe_ptr(&options.as_azure_draw_options())); + &dest.as_azure_rect(), + &source.as_azure_rect(), + &surf_options.as_azure_draw_surface_options(), + &options.as_azure_draw_options()); } } @@ -541,9 +541,9 @@ impl DrawTarget { unsafe { AzDrawTargetFillGlyphs(self.azure_draw_target, azfontref, - to_unsafe_ptr(&glyphbuf), + &glyphbuf, azure_pattern, - to_unsafe_ptr(&options), + &options, renderingOptions); } } diff --git a/scaled_font.rs b/scaled_font.rs index 78386a0..91a73c5 100644 --- a/scaled_font.rs +++ b/scaled_font.rs @@ -23,9 +23,9 @@ use scaled_font::android::*; #[cfg(target_os="macos")] pub mod macos { - extern mod core_foundation; - extern mod core_graphics; - extern mod core_text; + extern crate core_foundation; + extern crate core_graphics; + extern crate core_text; pub use scaled_font::macos::core_text::font::CTFontRef; pub use scaled_font::macos::core_graphics::font::{CGFont, CGFontRef}; @@ -33,14 +33,14 @@ pub mod macos { #[cfg(target_os="linux")] pub mod linux { - extern mod freetype; + extern crate freetype; pub use scaled_font::linux::freetype::freetype::{FT_Face, FT_LOAD_DEFAULT}; } #[cfg(target_os="android")] pub mod android { - extern mod freetype; + extern crate freetype; pub use scaled_font::android::freetype::freetype::{FT_Face, FT_LOAD_DEFAULT}; } From 06df2a814fe7ecb2b15d71d076975e674180a83a Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 14 Mar 2014 15:07:26 -0400 Subject: [PATCH 4/5] Warning police. --- azure.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure.rs b/azure.rs index 8e9a5aa..50177f7 100644 --- a/azure.rs +++ b/azure.rs @@ -4,7 +4,7 @@ /* automatically generated by rust-bindgen */ -#[allow(non_uppercase_statics)]; +#[allow(non_uppercase_statics, non_camel_case_types)]; use std::libc::*; From 3888887235c0d6ce0619131e14634afd4db0e129 Mon Sep 17 00:00:00 2001 From: Lars Bergstrom Date: Mon, 17 Mar 2014 20:10:17 -0500 Subject: [PATCH 5/5] Update link libraries to ensure that check-servo-net can link skia --- linkhack.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linkhack.rs b/linkhack.rs index 1a9fbaf..0d7f7cf 100644 --- a/linkhack.rs +++ b/linkhack.rs @@ -8,6 +8,8 @@ #[link(name = "azure")] #[link(name = "stdc++")] #[link(name = "skia")] +// skia must come before freetype for linking to succeed +#[link(name = "freetype")] // fontconfig must come before expat for linking to succeed #[link(name = "fontconfig")] #[link(name = "expat")]