From e782abbdf467d072f121f2508b21c0058d7a0b90 Mon Sep 17 00:00:00 2001 From: UK992 Date: Sun, 28 Feb 2016 17:37:07 +0100 Subject: [PATCH] Temporary fix for Windows --- Cargo.toml | 3 +++ src/lib.rs | 12 ++++++++++++ src/resource_cache.rs | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index b53f4ff2d9..a94217af11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,9 @@ git = "https://github.com/servo/rust-freetype" [target.aarch64-unknown-linux-gnu.dependencies.freetype] git = "https://github.com/servo/rust-freetype" +[target.x86_64-pc-windows-gnu.dependencies.freetype] +git = "https://github.com/servo/rust-freetype" + [dependencies.ipc-channel] git = "https://github.com/servo/ipc-channel" diff --git a/src/lib.rs b/src/lib.rs index 80d9d0d61b..dc4ac854de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,6 +44,18 @@ mod platform { pub mod linux { pub mod font; } + // Temporary solution to pass building on Windows + #[cfg(target_os = "windows")] + pub mod font { + pub struct FontContext; + impl FontContext { + pub fn new() -> FontContext { + FontContext + } + } + pub struct RasterizedGlyph; + impl RasterizedGlyph {} + } } pub mod renderer; diff --git a/src/resource_cache.rs b/src/resource_cache.rs index ad13d94afe..eb1aaaa765 100644 --- a/src/resource_cache.rs +++ b/src/resource_cache.rs @@ -302,6 +302,7 @@ impl ResourceCache { }); } + #[cfg(not(target_os = "windows"))] pub fn raster_pending_glyphs(&mut self, thread_pool: &mut scoped_threadpool::Pool, frame_id: FrameId) { @@ -353,6 +354,13 @@ impl ResourceCache { } } + #[cfg(target_os = "windows")] + pub fn raster_pending_glyphs(&mut self, + thread_pool: &mut scoped_threadpool::Pool, + frame_id: FrameId) { + return + } + pub fn add_draw_list(&mut self, items: Vec) -> DrawListId { self.draw_lists.insert(DrawList::new(items)) } @@ -433,6 +441,7 @@ impl ResourceCache { } } +#[cfg(not(target_os = "windows"))] fn run_raster_jobs(thread_pool: &mut scoped_threadpool::Pool, pending_raster_jobs: &mut Vec, font_templates: &HashMap>,