From d907bad78c70bbbfedb1470a5142c0daf8764cf8 Mon Sep 17 00:00:00 2001 From: "aydin.kim" Date: Tue, 10 Sep 2013 16:02:14 +0900 Subject: [PATCH] update android port for language changes --- src/components/gfx/platform/android/font.rs | 9 +++++++++ src/components/gfx/platform/android/font_context.rs | 2 ++ src/components/gfx/platform/android/font_list.rs | 4 ++++ src/components/main/platform/common/glut_windowing.rs | 2 +- src/support/glut/rust-glut | 2 +- src/support/http/rust-http | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/gfx/platform/android/font.rs b/src/components/gfx/platform/android/font.rs index aff744cae2d..2bc62b76a53 100644 --- a/src/components/gfx/platform/android/font.rs +++ b/src/components/gfx/platform/android/font.rs @@ -62,6 +62,7 @@ pub struct FontHandle { #[unsafe_destructor] impl Drop for FontHandle { + #[fixed_stack_segment] fn drop(&self) { assert!(self.face.is_not_null()); unsafe { @@ -99,6 +100,7 @@ impl FontHandleMethods for FontHandle { Err(()) => Err(()) }; + #[fixed_stack_segment] fn create_face_from_buffer(lib: FT_Library, cbuf: *u8, cbuflen: uint, pt_size: float) -> Result { @@ -130,12 +132,14 @@ impl FontHandleMethods for FontHandle { fn family_name(&self) -> ~str { unsafe { str::raw::from_c_str((*self.face).family_name) } } + #[fixed_stack_segment] fn face_name(&self) -> ~str { unsafe { str::raw::from_c_str(FT_Get_Postscript_Name(self.face)) } } fn is_italic(&self) -> bool { unsafe { (*self.face).style_flags & FT_STYLE_FLAG_ITALIC != 0 } } + #[fixed_stack_segment] fn boldness(&self) -> CSSFontWeight { let default_weight = FontWeight400; if unsafe { (*self.face).style_flags & FT_STYLE_FLAG_BOLD == 0 } { @@ -178,6 +182,7 @@ impl FontHandleMethods for FontHandle { } } + #[fixed_stack_segment] fn glyph_index(&self, codepoint: char) -> Option { assert!(self.face.is_not_null()); @@ -192,6 +197,7 @@ impl FontHandleMethods for FontHandle { } } + #[fixed_stack_segment] fn glyph_h_advance(&self, glyph: GlyphIndex) -> Option { assert!(self.face.is_not_null()); @@ -242,6 +248,7 @@ impl FontHandleMethods for FontHandle { } impl<'self> FontHandle { + #[fixed_stack_segment] fn set_char_size(face: FT_Face, pt_size: float) -> Result<(), ()>{ let char_width = float_to_fixed_ft(pt_size) as FT_F26Dot6; let char_height = float_to_fixed_ft(pt_size) as FT_F26Dot6; @@ -254,6 +261,7 @@ impl<'self> FontHandle { } } + #[fixed_stack_segment] pub fn new_from_file(fctx: &FontContextHandle, file: ~str, style: &SpecifiedFontStyle) -> Result { unsafe { @@ -281,6 +289,7 @@ impl<'self> FontHandle { } } + #[fixed_stack_segment] pub fn new_from_file_unstyled(fctx: &FontContextHandle, file: ~str) -> Result { unsafe { diff --git a/src/components/gfx/platform/android/font_context.rs b/src/components/gfx/platform/android/font_context.rs index 5a828ee7438..e2a97f55db6 100644 --- a/src/components/gfx/platform/android/font_context.rs +++ b/src/components/gfx/platform/android/font_context.rs @@ -17,6 +17,7 @@ struct FreeTypeLibraryHandle { } impl Drop for FreeTypeLibraryHandle { + #[fixed_stack_segment] fn drop(&self) { assert!(self.ctx.is_not_null()); unsafe { @@ -30,6 +31,7 @@ pub struct FontContextHandle { } impl FontContextHandle { + #[fixed_stack_segment] pub fn new() -> FontContextHandle { unsafe { let ctx: FT_Library = ptr::null(); diff --git a/src/components/gfx/platform/android/font_list.rs b/src/components/gfx/platform/android/font_list.rs index a598cebb316..13acbe465ce 100644 --- a/src/components/gfx/platform/android/font_list.rs +++ b/src/components/gfx/platform/android/font_list.rs @@ -39,6 +39,7 @@ impl FontListHandle { FontListHandle { fctx: fctx.clone() } } + #[fixed_stack_segment] pub fn get_available_families(&self) -> FontFamilyMap { let mut family_map : FontFamilyMap = HashMap::new(); unsafe { @@ -62,6 +63,7 @@ impl FontListHandle { return family_map; } + #[fixed_stack_segment] pub fn load_variations_for_family(&self, family: @mut FontFamily) { debug!("getting variations for %?", family); unsafe { @@ -138,6 +140,7 @@ struct AutoPattern { } impl Drop for AutoPattern { + #[fixed_stack_segment] fn drop(&self) { unsafe { FcPatternDestroy(self.pattern); @@ -145,6 +148,7 @@ impl Drop for AutoPattern { } } +#[fixed_stack_segment] pub fn path_from_identifier(name: ~str, style: &UsedFontStyle) -> Result<~str, ()> { unsafe { let config = FcConfigGetCurrent(); diff --git a/src/components/main/platform/common/glut_windowing.rs b/src/components/main/platform/common/glut_windowing.rs index e02bc04d7cb..373975a2ca1 100644 --- a/src/components/main/platform/common/glut_windowing.rs +++ b/src/components/main/platform/common/glut_windowing.rs @@ -59,7 +59,7 @@ impl WindowMethods for Window { /// Creates a new window. fn new(_: &Application) -> @mut Window { // Create the GLUT window. - unsafe { glut::glutInitWindowSize(800, 600); } + glut::init_window_size(800, 600); let glut_window = glut::create_window(~"Servo"); // Create our window object. diff --git a/src/support/glut/rust-glut b/src/support/glut/rust-glut index 24939d67ce4..91b81ab550c 160000 --- a/src/support/glut/rust-glut +++ b/src/support/glut/rust-glut @@ -1 +1 @@ -Subproject commit 24939d67ce465e3a44bb4adac56534c833478daf +Subproject commit 91b81ab550ce175a868b91ca3290bd9ef64954cd diff --git a/src/support/http/rust-http b/src/support/http/rust-http index 3359d736506..852c2c439b2 160000 --- a/src/support/http/rust-http +++ b/src/support/http/rust-http @@ -1 +1 @@ -Subproject commit 3359d73650614921718b84d6c680cd7898b35df7 +Subproject commit 852c2c439b2198989181d52e39e0e8cb28d64179