diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/gfx/font.rs | 69 | ||||
-rw-r--r-- | src/components/gfx/freetype_impl/font_context.rs | 6 | ||||
-rw-r--r-- | src/components/gfx/gfx.rs | 2 | ||||
-rw-r--r-- | src/components/main/layout/flow.rs | 17 | ||||
-rwxr-xr-x | src/components/main/servo.rs | 2 | ||||
-rw-r--r-- | src/components/msg/msg.rs | 2 | ||||
-rw-r--r-- | src/components/net/net.rs | 2 | ||||
-rw-r--r-- | src/components/script/script.rs | 2 | ||||
-rw-r--r-- | src/components/style/style.rs | 2 | ||||
-rw-r--r-- | src/components/util/util.rs | 2 |
10 files changed, 10 insertions, 96 deletions
diff --git a/src/components/gfx/font.rs b/src/components/gfx/font.rs index 470e1bb49bb..b6a97837d90 100644 --- a/src/components/gfx/font.rs +++ b/src/components/gfx/font.rs @@ -453,72 +453,3 @@ impl Font { } } -/*fn should_destruct_on_fail_without_leaking() { - #[test]; - #[should_fail]; - - let fctx = @FontContext(); - let matcher = @FontMatcher(fctx); - let _font = matcher.get_test_font(); - fail; -} - -fn should_get_glyph_indexes() { - #[test]; - - let fctx = @FontContext(); - let matcher = @FontMatcher(fctx); - let font = matcher.get_test_font(); - let glyph_idx = font.glyph_index('w'); - assert!(glyph_idx == Some(40u as GlyphIndex)); -} - -fn should_get_glyph_advance() { - #[test]; - #[ignore]; - - let fctx = @FontContext(); - let matcher = @FontMatcher(fctx); - let font = matcher.get_test_font(); - let x = font.glyph_h_advance(40u as GlyphIndex); - assert!(x == 15f || x == 16f); -} - -// Testing thread safety -fn should_get_glyph_advance_stress() { - #[test]; - #[ignore]; - - let mut ports = ~[]; - - for iter::repeat(100) { - let (chan, port) = pipes::stream(); - ports += [@port]; - spawn_named("should_get_glyph_advance_stress") { - let fctx = @FontContext(); - let matcher = @FontMatcher(fctx); - let _font = matcher.get_test_font(); - let x = font.glyph_h_advance(40u as GlyphIndex); - assert!(x == 15f || x == 16f); - chan.send(()); - } - } - - for ports.each |port| { - port.recv(); - } -} - -fn should_be_able_to_create_instances_in_multiple_threads() { - #[test]; - - for iter::repeat(10u) { - do task::spawn { - let fctx = @FontContext(); - let matcher = @FontMatcher(fctx); - let _font = matcher.get_test_font(); - } - } -} - -*/ diff --git a/src/components/gfx/freetype_impl/font_context.rs b/src/components/gfx/freetype_impl/font_context.rs index 4ae11ea9ade..bffe06ceda2 100644 --- a/src/components/gfx/freetype_impl/font_context.rs +++ b/src/components/gfx/freetype_impl/font_context.rs @@ -2,6 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +use std::rc::Rc; + extern mod freetype; extern mod fontconfig; @@ -34,7 +36,7 @@ impl Drop for FreeTypeLibraryHandle { } pub struct FreeTypeFontContextHandle { - ctx: @FreeTypeLibraryHandle, + ctx: Rc<FreeTypeLibraryHandle>, } pub impl FreeTypeFontContextHandle { @@ -44,7 +46,7 @@ pub impl FreeTypeFontContextHandle { if !result.succeeded() { fail!(); } FreeTypeFontContextHandle { - ctx: @FreeTypeLibraryHandle { ctx: ctx }, + ctx: Rc::new(FreeTypeLibraryHandle { ctx: ctx }), } } } diff --git a/src/components/gfx/gfx.rs b/src/components/gfx/gfx.rs index 1af989fbad1..3635d5d3b61 100644 --- a/src/components/gfx/gfx.rs +++ b/src/components/gfx/gfx.rs @@ -7,7 +7,7 @@ #[crate_type = "dylib"]; #[crate_type = "rlib"]; -#[feature(globs, managed_boxes, macro_rules, phase)]; +#[feature(globs, macro_rules, phase)]; #[feature(phase)]; #[phase(syntax, link)] diff --git a/src/components/main/layout/flow.rs b/src/components/main/layout/flow.rs index 1e5ab33ab37..96db9770a5d 100644 --- a/src/components/main/layout/flow.rs +++ b/src/components/main/layout/flow.rs @@ -805,23 +805,6 @@ impl Drop for BaseFlow { } } -pub struct BoxIterator { - priv boxes: ~[@Box], - priv index: uint, -} - -impl Iterator<@Box> for BoxIterator { - fn next(&mut self) -> Option<@Box> { - if self.index >= self.boxes.len() { - None - } else { - let v = self.boxes[self.index].clone(); - self.index += 1; - Some(v) - } - } -} - impl BaseFlow { #[inline] pub fn new(node: ThreadSafeLayoutNode) -> BaseFlow { diff --git a/src/components/main/servo.rs b/src/components/main/servo.rs index 562cd71ce28..72a28d93322 100755 --- a/src/components/main/servo.rs +++ b/src/components/main/servo.rs @@ -6,7 +6,7 @@ #[comment = "The Servo Parallel Browser Project"]; #[license = "MPL"]; -#[feature(globs, macro_rules, managed_boxes, phase, thread_local)]; +#[feature(globs, macro_rules, phase, thread_local)]; #[feature(phase)]; #[phase(syntax, link)] diff --git a/src/components/msg/msg.rs b/src/components/msg/msg.rs index e0823328e53..c3e332746f3 100644 --- a/src/components/msg/msg.rs +++ b/src/components/msg/msg.rs @@ -7,8 +7,6 @@ #[crate_type = "dylib"]; #[crate_type = "rlib"]; -#[feature(managed_boxes)]; - extern crate azure; extern crate geom; extern crate layers; diff --git a/src/components/net/net.rs b/src/components/net/net.rs index f23803af0bd..c0f1080e699 100644 --- a/src/components/net/net.rs +++ b/src/components/net/net.rs @@ -7,7 +7,7 @@ #[crate_type = "dylib"]; #[crate_type = "rlib"]; -#[feature(globs, managed_boxes)]; +#[feature(globs)]; #[feature(phase)]; #[phase(syntax, link)] diff --git a/src/components/script/script.rs b/src/components/script/script.rs index 3a94e9f9657..bb189ad9088 100644 --- a/src/components/script/script.rs +++ b/src/components/script/script.rs @@ -10,7 +10,7 @@ #[comment = "The Servo Parallel Browser Project"]; #[license = "MPL"]; -#[feature(globs, macro_rules, struct_variant, managed_boxes, phase)]; +#[feature(globs, macro_rules, struct_variant, phase)]; #[feature(phase)]; #[phase(syntax, link)] diff --git a/src/components/style/style.rs b/src/components/style/style.rs index b923b4cfa30..b296b34c035 100644 --- a/src/components/style/style.rs +++ b/src/components/style/style.rs @@ -10,7 +10,7 @@ #[comment = "The Servo Parallel Browser Project"]; #[license = "MPL"]; -#[feature(globs, macro_rules, managed_boxes)]; +#[feature(globs, macro_rules)]; #[feature(phase)]; #[phase(syntax, link)] extern crate log; diff --git a/src/components/util/util.rs b/src/components/util/util.rs index 27796803913..08e06e43b6e 100644 --- a/src/components/util/util.rs +++ b/src/components/util/util.rs @@ -7,7 +7,7 @@ #[crate_type = "dylib"]; #[crate_type = "rlib"]; -#[feature(macro_rules, managed_boxes)]; +#[feature(macro_rules)]; #[feature(phase)]; #[phase(syntax, link)] |