Permalink
Browse files

Update for language changes.

  • Loading branch information...
1 parent 157227e commit be1935e9ad499f053521cbb5e2721fdfacff84f5 @jdm jdm committed Dec 23, 2012
View
@@ -29,7 +29,7 @@ B := $(CFG_BUILD_DIR)
MKFILE_DEPS := config.stamp $(call rwildcard,$(S)mk/,*)
-CFG_RUSTC_FLAGS := $(RUSTFLAGS)
+CFG_RUSTC_FLAGS := $(RUSTFLAGS) -A default_methods
ifdef CFG_DISABLE_OPTIMIZE
$(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE))
View
@@ -8,7 +8,7 @@ against a released version of Rust will not work, nor will the Rust
'master' branch. The commit below will *probably* work. If it does not
then the topic in #servo might know better.
-* Last known-good Rust commit: 54ae377ec26ed47bbb627bdcb58bb10658cf03c4
+* Last known-good Rust commit: 3ee1d3ebb81de199fc630a86933ac18c0a869482
[rust]: http://www.rust-lang.org
View
@@ -21,7 +21,7 @@ use geom::{Point2D, Rect, Size2D};
pub type FontHandle/& = quartz::font::QuartzFontHandle;
#[cfg(target_os = "linux")]
-pub type FontHandle/& = freetype::font::FreeTypeFontHandle;
+pub type FontHandle/& = freetype_impl::font::FreeTypeFontHandle;
pub trait FontHandleMethods {
// an identifier usable by FontContextHandle to recreate this FontHandle.
@@ -51,7 +51,7 @@ pub impl FontHandle {
#[cfg(target_os = "linux")]
static pub fn new_from_buffer(fctx: &native::FontContextHandle, buf: ~[u8], style: &SpecifiedFontStyle) -> Result<FontHandle, ()> {
- freetype::font::FreeTypeFontHandle::new_from_buffer(fctx, move buf, style)
+ freetype_impl::font::FreeTypeFontHandle::new_from_buffer(fctx, move buf, style)
}
}
@@ -78,7 +78,7 @@ impl FontTableTag : FontTableTagConversions {
pub type FontTable/& = quartz::font::QuartzFontTable;
#[cfg(target_os = "linux")]
-pub type FontTable/& = freetype::font::FreeTypeFontTable;
+pub type FontTable/& = freetype_impl::font::FreeTypeFontTable;
pub trait FontTableMethods {
fn with_buffer(fn&(*u8, uint));
@@ -2,7 +2,7 @@ use font::{Font, FontDescriptor, FontGroup, FontStyle, SelectorPlatformIdentifie
use font::{SelectorStubDummy, SpecifiedFontStyle, UsedFontStyle};
use font_list::FontList;
use native::FontHandle;
-use util::cache;
+use util::cache::Cache;
use util::cache::MonoCache;
use azure::azure_hl::BackendType;
@@ -34,7 +34,7 @@ pub fn dummy_style() -> FontStyle {
type FontContextHandle/& = quartz::font_context::QuartzFontContextHandle;
#[cfg(target_os = "linux")]
-type FontContextHandle/& = freetype::font_context::FreeTypeFontContextHandle;
+type FontContextHandle/& = freetype_impl::font_context::FreeTypeFontContextHandle;
pub trait FontContextHandleMethods {
pure fn clone(&const self) -> FontContextHandle;
@@ -51,12 +51,12 @@ pub impl FontContextHandle {
#[cfg(target_os = "linux")]
static pub fn new() -> FontContextHandle {
- freetype::font_context::FreeTypeFontContextHandle::new()
+ freetype_impl::font_context::FreeTypeFontContextHandle::new()
}
}
pub struct FontContext {
- instance_cache: cache::MonoCache<FontDescriptor, @Font>,
+ instance_cache: MonoCache<FontDescriptor, @Font>,
font_list: Option<FontList>, // only needed by layout
handle: FontContextHandle,
backend: BackendType,
@@ -78,7 +78,7 @@ pub impl FontContext {
FontContext {
// TODO(Rust #3902): remove extraneous type parameters once they are inferred correctly.
- instance_cache: cache::new::<FontDescriptor,@Font,MonoCache<FontDescriptor,@Font>>(10),
+ instance_cache: Cache::new::<FontDescriptor,@Font,MonoCache<FontDescriptor,@Font>>(10),
font_list: move font_list,
handle: move handle,
backend: backend,
@@ -1,6 +1,6 @@
extern mod freetype;
-use font_context::FreeTypeFontContextHandle;
+use freetype_impl::font_context::FreeTypeFontContextHandle;
use gfx_font::{
CSSFontWeight,
FontHandle,
@@ -17,7 +17,7 @@ use geometry::Au;
use text::glyph::GlyphIndex;
use text::util::{float_to_fixed, fixed_to_float};
-use freetype::freetype::{
+use self::freetype::freetype::{
FTErrorMethods,
FT_Error,
FT_F26Dot6,
@@ -32,7 +32,7 @@ use freetype::freetype::{
FT_UInt,
FT_Size_Metrics,
};
-use freetype::freetype::bindgen::{
+use self::freetype::freetype::bindgen::{
FT_Init_FreeType,
FT_Done_FreeType,
FT_New_Memory_Face,
@@ -1,11 +1,11 @@
extern mod freetype;
-use freetype::freetype::{
+use self::freetype::freetype::{
FTErrorMethods,
FT_Error,
FT_Library,
};
-use freetype::freetype::bindgen::{
+use self::freetype::freetype::bindgen::{
FT_Init_FreeType,
FT_Done_FreeType
};
@@ -14,7 +14,7 @@ use gfx_font::{
FontHandle,
UsedFontStyle,
};
-use gfx_font_context::FontContextHandleMethods;
+use font_context::FontContextHandleMethods;
pub struct FreeTypeFontContextHandle {
ctx: FT_Library,
@@ -1,7 +1,7 @@
use geom::point::Point2D;
use geom::rect::Rect;
use geom::size::Size2D;
-use num::{Num, from_int};
+use num::Num;
pub enum Au = i32;
@@ -45,7 +45,7 @@ impl Au {
}
static pub pure fn from_px(i: int) -> Au {
- from_int(i * 60)
+ Num::from_int(i * 60)
}
pub pure fn to_px(&const self) -> int {
@@ -98,7 +98,7 @@ pub pure fn from_frac_px(f: float) -> Au {
}
pub pure fn from_px(i: int) -> Au {
- from_int(i * 60)
+ Num::from_int(i * 60)
}
pub pure fn to_px(au: Au) -> int {
View
@@ -66,12 +66,12 @@ pub fn from_cmdline_args(args: &[~str]) -> Opts {
};
let tile_size: uint = match getopts::opt_maybe_str(&opt_match, ~"s") {
- Some(move tile_size_str) => from_str::from_str(tile_size_str).get(),
+ Some(move tile_size_str) => uint::from_str(tile_size_str).get(),
None => 512,
};
let n_render_threads: uint = match getopts::opt_maybe_str(&opt_match, ~"t") {
- Some(move n_render_threads_str) => from_str::from_str(n_render_threads_str).get(),
+ Some(move n_render_threads_str) => uint::from_str(n_render_threads_str).get(),
None => 1, // FIXME: Number of cores.
};
@@ -3,9 +3,10 @@ use font_context::FontContext;
use opts::Opts;
use render_context::RenderContext;
use render_layers::{RenderLayer, render_layers};
+use resource::util::spawn_listener;
use azure::AzFloat;
-use core::comm::*;
+use core::oldcomm::*;
use core::libc::size_t;
use core::libc::types::common::c99::uint16_t;
use core::pipes::{Port, Chan};
@@ -21,12 +22,12 @@ pub enum Msg {
ExitMsg(pipes::Chan<()>)
}
-pub type RenderTask = comm::Chan<Msg>;
+pub type RenderTask = oldcomm::Chan<Msg>;
pub fn RenderTask<C: Compositor Owned>(compositor: C, opts: Opts) -> RenderTask {
let compositor_cell = Cell(move compositor);
let opts_cell = Cell(move opts);
- do task::spawn_listener |po: comm::Port<Msg>, move compositor_cell, move opts_cell| {
+ do spawn_listener |po: oldcomm::Port<Msg>, move compositor_cell, move opts_cell| {
let (layer_buffer_set_port, layer_buffer_channel) = pipes::stream();
let compositor = compositor_cell.take();
@@ -68,7 +69,7 @@ priv struct ThreadRenderContext {
}
priv struct Renderer<C: Compositor Owned> {
- port: comm::Port<Msg>,
+ port: oldcomm::Port<Msg>,
compositor: C,
layer_buffer_set_port: Cell<pipes::Port<LayerBufferSet>>,
thread_pool: TaskPool<ThreadRenderContext>,
@@ -1,6 +1,6 @@
export factory;
-use comm::Chan;
+use oldcomm::Chan;
use task::spawn;
use resource::resource_task::{ProgressMsg, Payload, Done};
use std::net::url::Url;
@@ -1,6 +1,6 @@
export factory;
-use comm::Chan;
+use oldcomm::Chan;
use task::spawn;
use resource::resource_task::{ProgressMsg, Payload, Done};
use std::net::url::Url;
@@ -5,7 +5,8 @@ use util::url::{make_url, UrlMap, url_map};
use clone_arc = std::arc::clone;
use core::pipes::{Chan, Port, SharedChan, stream};
-use core::task::{spawn, spawn_listener};
+use core::task::spawn;
+use resource::util::spawn_listener;
use core::to_str::ToStr;
use core::util::replace;
use std::arc::ARC;
@@ -464,7 +465,7 @@ impl ImageCacheTask: ImageCacheTaskClient {
}
fn load_image_data(url: Url, resource_task: ResourceTask) -> Result<~[u8], ()> {
- let response_port = comm::Port();
+ let response_port = oldcomm::Port();
resource_task.send(resource_task::Load(move url, response_port.chan()));
let mut image_data = ~[];
@@ -489,8 +490,8 @@ fn default_decoder_factory() -> ~fn(&[u8]) -> Option<Image> {
}
#[cfg(test)]
-fn mock_resource_task(on_load: ~fn(resource: comm::Chan<resource_task::ProgressMsg>)) -> ResourceTask {
- do spawn_listener |port: comm::Port<resource_task::ControlMsg>, move on_load| {
+fn mock_resource_task(on_load: ~fn(resource: oldcomm::Chan<resource_task::ProgressMsg>)) -> ResourceTask {
+ do spawn_listener |port: oldcomm::Port<resource_task::ControlMsg>, move on_load| {
loop {
match port.recv() {
resource_task::Load(_, response) => {
@@ -530,7 +531,7 @@ fn should_fail_if_unprefetched_image_is_requested() {
#[test]
fn should_request_url_from_resource_task_on_prefetch() {
- let url_requested = comm::Port();
+ let url_requested = oldcomm::Port();
let url_requested_chan = url_requested.chan();
let mock_resource_task = do mock_resource_task |response| {
@@ -4,8 +4,8 @@ A task that takes a URL and streams back the binary data
*/
-use comm::{Chan, Port};
-use task::{spawn, spawn_listener};
+use oldcomm::{Chan, Port};
+use resource::util::spawn_listener;
use std::net::url;
use std::net::url::{Url, to_str};
@@ -0,0 +1,12 @@
+pub fn spawn_listener<A: Owned>(
+ +f: fn~(oldcomm::Port<A>)) -> oldcomm::Chan<A> {
+ let setup_po = oldcomm::Port();
+ let setup_ch = oldcomm::Chan(&setup_po);
+ do task::spawn |move f| {
+ let po = oldcomm::Port();
+ let ch = oldcomm::Chan(&po);
+ oldcomm::send(setup_ch, ch);
+ f(move po);
+ }
+ oldcomm::recv(setup_po)
+}
View
@@ -36,37 +36,28 @@ pub mod native;
#[cfg(target_os = "macos")]
pub mod quartz {
- #[path = "quartz/font.rs"]
pub mod font;
- #[path = "quartz/font_context.rs"]
pub mod font_context;
- #[path = "quartz/font_list.rs"]
pub mod font_list;
}
#[cfg(target_os = "linux")]
-pub mod freetype {
- #[path = "freetype/font.rs"]
+pub mod freetype_impl {
pub mod font;
- #[path = "freetype/font_context.rs"]
pub mod font_context;
}
#[cfg(target_os = "linux")]
pub mod fontconfig {
- #[path = "fontconfig/font_list.rs"]
pub mod font_list;
}
// Images
pub mod image {
- #[path = "image/base.rs"]
pub mod base;
pub mod encode {
- #[path = "image/encode/tga.rs"]
pub mod tga;
}
- #[path = "image/holder.rs"]
pub mod holder;
}
@@ -76,28 +67,19 @@ pub mod text;
// FIXME: Blech. This does not belong in the GFX module.
pub mod resource {
- #[path = "resource/file_loader.rs"]
pub mod file_loader;
- #[path = "resource/http_loader.rs"]
pub mod http_loader;
- #[path = "resource/image_cache_task.rs"]
pub mod image_cache_task;
- #[path = "resource/local_image_cache.rs"]
pub mod local_image_cache;
- #[path = "resource/resource_task.rs"]
pub mod resource_task;
+ pub mod util;
}
pub mod util {
- #[path = "util/cache.rs"]
pub mod cache;
- #[path = "util/range.rs"]
pub mod range;
- #[path = "util/time.rs"]
pub mod time;
- #[path = "util/url.rs"]
pub mod url;
- #[path = "util/vec.rs"]
pub mod vec;
}
Oops, something went wrong.

0 comments on commit be1935e

Please sign in to comment.