Update submodules and ~str/String, to_owned/to_string, & cast/mem to get android building.

This commit is contained in:
Luqman Aden 2014-06-10 05:10:08 -04:00
parent 4b5fd956bd
commit 841a6bf647
12 changed files with 25 additions and 25 deletions

View file

@ -111,7 +111,7 @@ rust: $(CFG_RUSTC)
# These arguments are automatically provided by the Rust compiler's build process to # These arguments are automatically provided by the Rust compiler's build process to
# itself, so they must be specified later for our Rust modules. # itself, so they must be specified later for our Rust modules.
ifeq ($(CFG_OSTYPE),linux-androideabi) ifeq ($(CFG_OSTYPE),linux-androideabi)
CFG_RUSTC_FLAGS += --target arm-linux-androideabi -C android-cross-path=$(CFG_ANDROID_CROSS_PATH) CFG_RUSTC_FLAGS += --target arm-linux-androideabi -C linker=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++ -C ar=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar
endif endif
# Strip off submodule paths to determine "raw" submodule names. # Strip off submodule paths to determine "raw" submodule names.

View file

@ -24,7 +24,7 @@ use freetype::freetype::{FT_SizeRec, FT_UInt, FT_Size_Metrics};
use freetype::freetype::{ft_sfnt_os2}; use freetype::freetype::{ft_sfnt_os2};
use freetype::tt_os2::TT_OS2; use freetype::tt_os2::TT_OS2;
use std::cast; use std::mem;
use std::ptr; use std::ptr;
use std::str; use std::str;
@ -48,7 +48,7 @@ impl FontTableMethods for FontTable {
enum FontSource { enum FontSource {
FontSourceMem(Vec<u8>), FontSourceMem(Vec<u8>),
FontSourceFile(~str) FontSourceFile(String)
} }
pub struct FontHandle { pub struct FontHandle {
@ -117,15 +117,15 @@ impl FontHandleMethods for FontHandle {
} }
// an identifier usable by FontContextHandle to recreate this FontHandle. // an identifier usable by FontContextHandle to recreate this FontHandle.
fn face_identifier(&self) -> ~str { fn face_identifier(&self) -> String {
/* FT_Get_Postscript_Name seems like a better choice here, but it /* FT_Get_Postscript_Name seems like a better choice here, but it
doesn't give usable results for fontconfig when deserializing. */ doesn't give usable results for fontconfig when deserializing. */
unsafe { str::raw::from_c_str((*self.face).family_name) } unsafe { str::raw::from_c_str((*self.face).family_name) }
} }
fn family_name(&self) -> ~str { fn family_name(&self) -> String {
unsafe { str::raw::from_c_str((*self.face).family_name) } unsafe { str::raw::from_c_str((*self.face).family_name) }
} }
fn face_name(&self) -> ~str { fn face_name(&self) -> String {
unsafe { str::raw::from_c_str(FT_Get_Postscript_Name(self.face)) } unsafe { str::raw::from_c_str(FT_Get_Postscript_Name(self.face)) }
} }
fn is_italic(&self) -> bool { fn is_italic(&self) -> bool {
@ -168,7 +168,7 @@ impl FontHandleMethods for FontHandle {
FontHandleMethods::new_from_buffer(fctx, buf.clone(), style) FontHandleMethods::new_from_buffer(fctx, buf.clone(), style)
} }
FontSourceFile(ref file) => { FontSourceFile(ref file) => {
FontHandle::new_from_file(fctx, (*file).clone(), style) FontHandle::new_from_file(fctx, file.as_slice(), style)
} }
} }
} }
@ -194,7 +194,7 @@ impl FontHandleMethods for FontHandle {
let res = FT_Load_Glyph(self.face, glyph as FT_UInt, 0); let res = FT_Load_Glyph(self.face, glyph as FT_UInt, 0);
if res.succeeded() { if res.succeeded() {
let void_glyph = (*self.face).glyph; let void_glyph = (*self.face).glyph;
let slot: FT_GlyphSlot = cast::transmute(void_glyph); let slot: FT_GlyphSlot = mem::transmute(void_glyph);
assert!(slot.is_not_null()); assert!(slot.is_not_null());
debug!("metrics: {:?}", (*slot).metrics); debug!("metrics: {:?}", (*slot).metrics);
let advance = (*slot).metrics.horiAdvance; let advance = (*slot).metrics.horiAdvance;
@ -303,7 +303,7 @@ impl<'a> FontHandle {
} }
} }
pub fn new_from_file_unstyled(fctx: &FontContextHandle, file: ~str) pub fn new_from_file_unstyled(fctx: &FontContextHandle, file: String)
-> Result<FontHandle, ()> { -> Result<FontHandle, ()> {
unsafe { unsafe {
let ft_ctx: FT_Library = fctx.ctx.ctx; let ft_ctx: FT_Library = fctx.ctx.ctx;
@ -338,7 +338,7 @@ impl<'a> FontHandle {
// face.size is a *c_void in the bindings, presumably to avoid // face.size is a *c_void in the bindings, presumably to avoid
// recursive structural types // recursive structural types
let size: &FT_SizeRec = unsafe { cast::transmute(&(*face.size)) }; let size: &FT_SizeRec = unsafe { mem::transmute(&(*face.size)) };
let metrics: &FT_Size_Metrics = &(*size).metrics; let metrics: &FT_Size_Metrics = &(*size).metrics;
let em_size = face.units_per_EM as f64; let em_size = face.units_per_EM as f64;

View file

@ -44,12 +44,12 @@ impl FontContextHandle {
} }
impl FontContextHandleMethods for FontContextHandle { impl FontContextHandleMethods for FontContextHandle {
fn create_font_from_identifier(&self, name: ~str, style: UsedFontStyle) fn create_font_from_identifier(&self, name: String, style: UsedFontStyle)
-> Result<FontHandle, ()> { -> Result<FontHandle, ()> {
debug!("Creating font handle for {:s}", name); debug!("Creating font handle for {:s}", name);
path_from_identifier(name, &style).and_then(|file_name| { path_from_identifier(name, &style).and_then(|file_name| {
debug!("Opening font face {:s}", file_name); debug!("Opening font face {:s}", file_name);
FontHandle::new_from_file(self, file_name.to_string(), &style) FontHandle::new_from_file(self, file_name.as_slice(), &style)
}) })
} }
} }

View file

@ -53,7 +53,7 @@ impl FontListHandle {
while FcPatternGetString(*font, FC_FAMILY, v, &family) == FcResultMatch { while FcPatternGetString(*font, FC_FAMILY, v, &family) == FcResultMatch {
let family_name = str::raw::from_c_str(family as *c_char); let family_name = str::raw::from_c_str(family as *c_char);
debug!("Creating new FontFamily for family: {:s}", family_name); debug!("Creating new FontFamily for family: {:s}", family_name);
let new_family = FontFamily::new(family_name); let new_family = FontFamily::new(family_name.as_slice());
family_map.insert(family_name, new_family); family_map.insert(family_name, new_family);
v += 1; v += 1;
} }
@ -129,7 +129,7 @@ impl FontListHandle {
} }
} }
pub fn get_last_resort_font_families() -> Vec<~str> { pub fn get_last_resort_font_families() -> Vec<String> {
vec!("Roboto".to_string()) vec!("Roboto".to_string())
} }
} }
@ -146,7 +146,7 @@ impl Drop for AutoPattern {
} }
} }
pub fn path_from_identifier(name: ~str, style: &UsedFontStyle) -> Result<~str, ()> { pub fn path_from_identifier(name: String, style: &UsedFontStyle) -> Result<String, ()> {
unsafe { unsafe {
let config = FcConfigGetCurrent(); let config = FcConfigGetCurrent();
let wrapper = AutoPattern { pattern: FcPatternCreate() }; let wrapper = AutoPattern { pattern: FcPatternCreate() };

View file

@ -98,7 +98,7 @@ impl WindowMethods<Application> for Window {
impl glut::ReshapeCallback for ReshapeCallbackState { impl glut::ReshapeCallback for ReshapeCallbackState {
fn call(&self, width: c_int, height: c_int) { fn call(&self, width: c_int, height: c_int) {
let tmp = local_window(); let tmp = local_window();
tmp.event_queue.borrow_mut().push(ResizeWindowEvent(width as uint, height as uint)) tmp.event_queue.borrow_mut().push(ResizeWindowEvent(TypedSize2D(width as uint, height as uint)))
} }
} }
glut::reshape_func(glut_window, box ReshapeCallbackState); glut::reshape_func(glut_window, box ReshapeCallbackState);
@ -279,7 +279,7 @@ impl Window {
alert.add_prompt(); alert.add_prompt();
alert.run(); alert.run();
let value = alert.prompt_value(); let value = alert.prompt_value();
if "" == value { // To avoid crashing on Linux. if "" == value.as_slice() { // To avoid crashing on Linux.
self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_string())) self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_string()))
} else { } else {
self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone())) self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone()))

View file

@ -142,7 +142,7 @@ fn start(argc: int, argv: **u8) -> int {
#[allow(dead_code)] #[allow(dead_code)]
pub extern "C" fn android_start(argc: int, argv: **u8) -> int { pub extern "C" fn android_start(argc: int, argv: **u8) -> int {
native::start(argc, argv, proc() { native::start(argc, argv, proc() {
let mut args: Vec<~str> = vec!(); let mut args: Vec<String> = vec!();
for i in range(0u, argc as uint) { for i in range(0u, argc as uint) {
unsafe { unsafe {
args.push(str::raw::from_c_str(*argv.offset(i as int) as *i8)); args.push(str::raw::from_c_str(*argv.offset(i as int) as *i8));

View file

@ -8,12 +8,12 @@ use platform::surface::NativeSurfaceAzureMethods;
use azure::AzSkiaGrGLSharedSurfaceRef; use azure::AzSkiaGrGLSharedSurfaceRef;
use layers::platform::surface::NativeSurface; use layers::platform::surface::NativeSurface;
use std::cast; use std::mem;
impl NativeSurfaceAzureMethods for NativeSurface { impl NativeSurfaceAzureMethods for NativeSurface {
fn from_azure_surface(surface: AzSkiaGrGLSharedSurfaceRef) -> NativeSurface { fn from_azure_surface(surface: AzSkiaGrGLSharedSurfaceRef) -> NativeSurface {
unsafe { unsafe {
NativeSurface::from_image_khr(cast::transmute(surface)) NativeSurface::from_image_khr(mem::transmute(surface))
} }
} }
} }

@ -1 +1 @@
Subproject commit 6b86f1f01ecb4623942369d25e0dd941adb091de Subproject commit b9f00f05f931b445c22df85d94d4afd24e225e55

@ -1 +1 @@
Subproject commit 89b30aee451af87579b2d3f0c46ed739cc4dcc19 Subproject commit 0da3a63940928060d0d76ed40206ebc06e7094cc

@ -1 +1 @@
Subproject commit 4257b7b8400a09a5e5de2bb16a4621776a62328a Subproject commit 9f77014d418e8a4b228ef796149ccc759f79065d

@ -1 +1 @@
Subproject commit 2fd4c58480e7c8aa8000a3cbe5d935c59b94eaef Subproject commit 5004481eb0b5fdbb24d2ca56fd47767be7690057

View file

@ -133,7 +133,7 @@ fn make_test(reftest: Reftest) -> TestDescAndFn {
fn capture(reftest: &Reftest, side: uint) -> png::Image { fn capture(reftest: &Reftest, side: uint) -> png::Image {
let filename = format!("/tmp/servo-reftest-{:06u}-{:u}.png", reftest.id, side); let filename = format!("/tmp/servo-reftest-{:06u}-{:u}.png", reftest.id, side);
let mut args = reftest.servo_args.clone(); let mut args = reftest.servo_args.clone();
args.push_all_move(vec!("-f".to_owned(), "-o".to_owned(), filename.clone(), reftest.files[side].clone())); args.push_all_move(vec!("-f".to_string(), "-o".to_string(), filename.clone(), reftest.files[side].clone()));
let retval = match Command::new("./servo").args(args.as_slice()).status() { let retval = match Command::new("./servo").args(args.as_slice()).status() {
Ok(status) => status, Ok(status) => status,