diff options
author | Luqman Aden <laden@csclub.uwaterloo.ca> | 2014-06-10 05:10:08 -0400 |
---|---|---|
committer | Luqman Aden <laden@csclub.uwaterloo.ca> | 2014-06-10 13:00:03 -0400 |
commit | 841a6bf6475107bcf5ce39a8fd9e90de3965dce1 (patch) | |
tree | b0172c740e26c0213c52c45176442321c0254ca2 /src | |
parent | 4b5fd956bda51e10e4a42e1b9640f1c541b393da (diff) | |
download | servo-841a6bf6475107bcf5ce39a8fd9e90de3965dce1.tar.gz servo-841a6bf6475107bcf5ce39a8fd9e90de3965dce1.zip |
Update submodules and ~str/String, to_owned/to_string, & cast/mem to get android building.
Diffstat (limited to 'src')
-rw-r--r-- | src/components/gfx/platform/android/font.rs | 18 | ||||
-rw-r--r-- | src/components/gfx/platform/android/font_context.rs | 4 | ||||
-rw-r--r-- | src/components/gfx/platform/android/font_list.rs | 6 | ||||
-rw-r--r-- | src/components/main/platform/common/glut_windowing.rs | 4 | ||||
-rw-r--r-- | src/components/main/servo.rs | 2 | ||||
-rw-r--r-- | src/components/msg/platform/android/surface.rs | 4 | ||||
m--------- | src/support/alert/rust-alert | 0 | ||||
m--------- | src/support/egl/rust-egl | 0 | ||||
m--------- | src/support/glut/rust-glut | 0 | ||||
m--------- | src/support/layers/rust-layers | 0 | ||||
-rw-r--r-- | src/test/harness/reftest/reftest.rs | 2 |
11 files changed, 20 insertions, 20 deletions
diff --git a/src/components/gfx/platform/android/font.rs b/src/components/gfx/platform/android/font.rs index 4c5f5245384..e0dd18d8b55 100644 --- a/src/components/gfx/platform/android/font.rs +++ b/src/components/gfx/platform/android/font.rs @@ -24,7 +24,7 @@ use freetype::freetype::{FT_SizeRec, FT_UInt, FT_Size_Metrics}; use freetype::freetype::{ft_sfnt_os2}; use freetype::tt_os2::TT_OS2; -use std::cast; +use std::mem; use std::ptr; use std::str; @@ -48,7 +48,7 @@ impl FontTableMethods for FontTable { enum FontSource { FontSourceMem(Vec<u8>), - FontSourceFile(~str) + FontSourceFile(String) } pub struct FontHandle { @@ -117,15 +117,15 @@ impl FontHandleMethods for 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 doesn't give usable results for fontconfig when deserializing. */ 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) } } - fn face_name(&self) -> ~str { + fn face_name(&self) -> String { unsafe { str::raw::from_c_str(FT_Get_Postscript_Name(self.face)) } } fn is_italic(&self) -> bool { @@ -168,7 +168,7 @@ impl FontHandleMethods for FontHandle { FontHandleMethods::new_from_buffer(fctx, buf.clone(), style) } 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); if res.succeeded() { 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()); debug!("metrics: {:?}", (*slot).metrics); 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, ()> { unsafe { 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 // 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 em_size = face.units_per_EM as f64; diff --git a/src/components/gfx/platform/android/font_context.rs b/src/components/gfx/platform/android/font_context.rs index af65a30aa22..cea1cbf5cb0 100644 --- a/src/components/gfx/platform/android/font_context.rs +++ b/src/components/gfx/platform/android/font_context.rs @@ -44,12 +44,12 @@ impl 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, ()> { debug!("Creating font handle for {:s}", name); path_from_identifier(name, &style).and_then(|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) }) } } diff --git a/src/components/gfx/platform/android/font_list.rs b/src/components/gfx/platform/android/font_list.rs index 52a173d45bd..150646c9840 100644 --- a/src/components/gfx/platform/android/font_list.rs +++ b/src/components/gfx/platform/android/font_list.rs @@ -53,7 +53,7 @@ impl FontListHandle { while FcPatternGetString(*font, FC_FAMILY, v, &family) == FcResultMatch { let family_name = str::raw::from_c_str(family as *c_char); 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); 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()) } } @@ -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 { let config = FcConfigGetCurrent(); let wrapper = AutoPattern { pattern: FcPatternCreate() }; diff --git a/src/components/main/platform/common/glut_windowing.rs b/src/components/main/platform/common/glut_windowing.rs index 4d6a88c9bc2..a38521207e4 100644 --- a/src/components/main/platform/common/glut_windowing.rs +++ b/src/components/main/platform/common/glut_windowing.rs @@ -98,7 +98,7 @@ impl WindowMethods<Application> for Window { impl glut::ReshapeCallback for ReshapeCallbackState { fn call(&self, width: c_int, height: c_int) { 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); @@ -279,7 +279,7 @@ impl Window { alert.add_prompt(); alert.run(); 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())) } else { self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone())) diff --git a/src/components/main/servo.rs b/src/components/main/servo.rs index 543244de0ba..c7a2a6150b7 100644 --- a/src/components/main/servo.rs +++ b/src/components/main/servo.rs @@ -142,7 +142,7 @@ fn start(argc: int, argv: **u8) -> int { #[allow(dead_code)] pub extern "C" fn android_start(argc: int, argv: **u8) -> int { 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) { unsafe { args.push(str::raw::from_c_str(*argv.offset(i as int) as *i8)); diff --git a/src/components/msg/platform/android/surface.rs b/src/components/msg/platform/android/surface.rs index 04719ffdc39..6f2e962d804 100644 --- a/src/components/msg/platform/android/surface.rs +++ b/src/components/msg/platform/android/surface.rs @@ -8,12 +8,12 @@ use platform::surface::NativeSurfaceAzureMethods; use azure::AzSkiaGrGLSharedSurfaceRef; use layers::platform::surface::NativeSurface; -use std::cast; +use std::mem; impl NativeSurfaceAzureMethods for NativeSurface { fn from_azure_surface(surface: AzSkiaGrGLSharedSurfaceRef) -> NativeSurface { unsafe { - NativeSurface::from_image_khr(cast::transmute(surface)) + NativeSurface::from_image_khr(mem::transmute(surface)) } } } diff --git a/src/support/alert/rust-alert b/src/support/alert/rust-alert -Subproject 6b86f1f01ecb4623942369d25e0dd941adb091d +Subproject b9f00f05f931b445c22df85d94d4afd24e225e5 diff --git a/src/support/egl/rust-egl b/src/support/egl/rust-egl -Subproject 89b30aee451af87579b2d3f0c46ed739cc4dcc1 +Subproject 0da3a63940928060d0d76ed40206ebc06e7094c diff --git a/src/support/glut/rust-glut b/src/support/glut/rust-glut -Subproject 4257b7b8400a09a5e5de2bb16a4621776a62328 +Subproject 9f77014d418e8a4b228ef796149ccc759f79065 diff --git a/src/support/layers/rust-layers b/src/support/layers/rust-layers -Subproject 2fd4c58480e7c8aa8000a3cbe5d935c59b94eae +Subproject 5004481eb0b5fdbb24d2ca56fd47767be769005 diff --git a/src/test/harness/reftest/reftest.rs b/src/test/harness/reftest/reftest.rs index 255b2b55672..34da93d3731 100644 --- a/src/test/harness/reftest/reftest.rs +++ b/src/test/harness/reftest/reftest.rs @@ -133,7 +133,7 @@ fn make_test(reftest: Reftest) -> TestDescAndFn { fn capture(reftest: &Reftest, side: uint) -> png::Image { let filename = format!("/tmp/servo-reftest-{:06u}-{:u}.png", reftest.id, side); 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() { Ok(status) => status, |