diff options
-rw-r--r-- | Cargo.lock | 1 | ||||
-rw-r--r-- | components/gfx/display_list/mod.rs | 3 | ||||
-rw-r--r-- | components/gfx/font_context.rs | 16 | ||||
-rw-r--r-- | components/gfx/render_task.rs | 10 | ||||
-rw-r--r-- | components/util/Cargo.toml | 3 | ||||
-rw-r--r-- | components/util/lib.rs | 1 | ||||
-rw-r--r-- | components/util/opts.rs | 25 | ||||
-rw-r--r-- | ports/android/glut_app/Cargo.lock | 1 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 1 | ||||
-rw-r--r-- | ports/cef/core.rs | 1 |
10 files changed, 16 insertions, 46 deletions
diff --git a/Cargo.lock b/Cargo.lock index 498a3dd321a..d0aeafa535f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -488,7 +488,6 @@ dependencies = [ name = "util" version = "0.0.1" dependencies = [ - "azure 0.1.0 (git+https://github.com/servo/rust-azure#b357751c04a89a87e6ef1f0cebe5f20957dd112d)", "geom 0.1.0 (git+https://github.com/servo/rust-geom#b001a76e907befaae1d0d6dd259418a22092da86)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#124b891ebb4564743068f99aaeb0e154de343efb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#124b891ebb4564743068f99aaeb0e154de343efb)", diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index afa80ca477a..a82742f6580 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -555,8 +555,7 @@ impl DisplayItem { render_context.font_ctx.get_render_font_from_template( &text.text_run.font_template, - text.text_run.actual_pt_size, - render_context.opts.render_backend + text.text_run.actual_pt_size ).borrow().draw_text_into_context( render_context, &*text.text_run, diff --git a/components/gfx/font_context.rs b/components/gfx/font_context.rs index 997a20e63f6..efb40d16abd 100644 --- a/components/gfx/font_context.rs +++ b/components/gfx/font_context.rs @@ -20,7 +20,7 @@ use std::cell::RefCell; use sync::Arc; use azure::AzFloat; -use azure::azure_hl::BackendType; +use azure::azure_hl::SkiaBackend; use azure::scaled_font::ScaledFont; #[cfg(target_os="linux")] @@ -29,14 +29,14 @@ use azure::scaled_font::FontData; #[cfg(target_os="linux")] #[cfg(target_os="android")] -fn create_scaled_font(backend: BackendType, template: &Arc<FontTemplateData>, pt_size: f64) -> ScaledFont { - ScaledFont::new(backend, FontData(&template.bytes), pt_size as AzFloat) +fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: f64) -> ScaledFont { + ScaledFont::new(SkiaBackend, FontData(&template.bytes), pt_size as AzFloat) } #[cfg(target_os="macos")] -fn create_scaled_font(backend: BackendType, template: &Arc<FontTemplateData>, pt_size: f64) -> ScaledFont { +fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: f64) -> ScaledFont { let cgfont = template.ctfont.as_ref().unwrap().copy_to_CGFont(); - ScaledFont::new(backend, &cgfont, pt_size as AzFloat) + ScaledFont::new(SkiaBackend, &cgfont, pt_size as AzFloat) } static SMALL_CAPS_SCALE_FACTOR: f64 = 0.8; // Matches FireFox (see gfxFont.h) @@ -199,7 +199,9 @@ impl FontContext { /// Create a render font for use with azure. May return a cached /// reference if already used by this font context. - pub fn get_render_font_from_template(&mut self, template: &Arc<FontTemplateData>, pt_size: f64, backend: BackendType) -> Rc<RefCell<ScaledFont>> { + pub fn get_render_font_from_template(&mut self, + template: &Arc<FontTemplateData>, + pt_size: f64) -> Rc<RefCell<ScaledFont>> { for cached_font in self.render_font_cache.iter() { if cached_font.pt_size == pt_size && cached_font.identifier == template.identifier { @@ -207,7 +209,7 @@ impl FontContext { } } - let render_font = Rc::new(RefCell::new(create_scaled_font(backend, template, pt_size))); + let render_font = Rc::new(RefCell::new(create_scaled_font(template, pt_size))); self.render_font_cache.push(RenderFontCacheEntry{ font: render_font.clone(), pt_size: pt_size, diff --git a/components/gfx/render_task.rs b/components/gfx/render_task.rs index 8ddc5f232b2..bfaaf94e238 100644 --- a/components/gfx/render_task.rs +++ b/components/gfx/render_task.rs @@ -10,7 +10,7 @@ use display_list::DisplayList; use font_context::FontContext; use render_context::RenderContext; -use azure::azure_hl::{B8G8R8A8, Color, DrawTarget, StolenGLResources}; +use azure::azure_hl::{B8G8R8A8, Color, DrawTarget, SkiaBackend, StolenGLResources}; use azure::AzFloat; use geom::matrix2d::Matrix2D; use geom::point::Point2D; @@ -317,17 +317,19 @@ impl<C:RenderListener + Send> RenderTask<C> { let width = tile.screen_rect.size.width; let height = tile.screen_rect.size.height; + // TODO: In the future we'll want to re-enable configuring the + // rendering backend - it's hardcoded to Skia below for now + // since none of the other backends work at all. let size = Size2D(width as i32, height as i32); let draw_target = match self.graphics_context { CpuGraphicsContext => { - DrawTarget::new(self.opts.render_backend, size, B8G8R8A8) + DrawTarget::new(SkiaBackend, size, B8G8R8A8) } GpuGraphicsContext => { // FIXME(pcwalton): Cache the components of draw targets // (texture color buffer, renderbuffers) instead of recreating them. let draw_target = - DrawTarget::new_with_fbo(self.opts.render_backend, - native_graphics_context!(self), + DrawTarget::new_with_fbo(SkiaBackend, native_graphics_context!(self), size, B8G8R8A8); draw_target.make_current(); diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml index d0606c4ee8f..f25072f825f 100644 --- a/components/util/Cargo.toml +++ b/components/util/Cargo.toml @@ -7,9 +7,6 @@ authors = ["The Servo Project Developers"] name = "util" path = "lib.rs" -[dependencies.azure] -git = "https://github.com/servo/rust-azure" - [dependencies.geom] git = "https://github.com/servo/rust-geom" diff --git a/components/util/lib.rs b/components/util/lib.rs index e820c0e2c11..f5fd08dc24e 100644 --- a/components/util/lib.rs +++ b/components/util/lib.rs @@ -12,7 +12,6 @@ extern crate log; extern crate debug; extern crate alloc; -extern crate azure; extern crate collections; extern crate geom; extern crate getopts; diff --git a/components/util/opts.rs b/components/util/opts.rs index cedfa26f7ae..66d3ff6410d 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -7,8 +7,6 @@ use geometry::ScreenPx; -use azure::azure_hl::{BackendType, CairoBackend, CoreGraphicsBackend}; -use azure::azure_hl::{CoreGraphicsAcceleratedBackend, Direct2DBackend, SkiaBackend}; use geom::scale_factor::ScaleFactor; use geom::size::TypedSize2D; use layers::geometry::DevicePixel; @@ -25,9 +23,6 @@ pub struct Opts { /// The initial URLs to load. pub urls: Vec<String>, - /// The rendering backend to use (`-r`). - pub render_backend: BackendType, - /// How many threads to use for CPU rendering (`-t`). /// /// FIXME(pcwalton): This is not currently used. All rendering is sequential. @@ -163,25 +158,6 @@ pub fn from_cmdline_args(args: &[String]) -> Option<Opts> { opt_match.free.clone() }; - let render_backend = match opt_match.opt_str("r") { - Some(backend_str) => { - if "direct2d" == backend_str.as_slice() { - Direct2DBackend - } else if "core-graphics" == backend_str.as_slice() { - CoreGraphicsBackend - } else if "core-graphics-accelerated" == backend_str.as_slice() { - CoreGraphicsAcceleratedBackend - } else if "cairo" == backend_str.as_slice() { - CairoBackend - } else if "skia" == backend_str.as_slice() { - SkiaBackend - } else { - fail!("unknown backend type") - } - } - None => SkiaBackend - }; - let tile_size: uint = match opt_match.opt_str("s") { Some(tile_size_str) => from_str(tile_size_str.as_slice()).unwrap(), None => 512, @@ -238,7 +214,6 @@ pub fn from_cmdline_args(args: &[String]) -> Option<Opts> { let opts = Opts { urls: urls, - render_backend: render_backend, n_render_threads: n_render_threads, cpu_painting: cpu_painting, tile_size: tile_size, diff --git a/ports/android/glut_app/Cargo.lock b/ports/android/glut_app/Cargo.lock index e083e8c9cba..5fad2d1bea9 100644 --- a/ports/android/glut_app/Cargo.lock +++ b/ports/android/glut_app/Cargo.lock @@ -496,7 +496,6 @@ dependencies = [ name = "util" version = "0.0.1" dependencies = [ - "azure 0.1.0 (git+https://github.com/servo/rust-azure#b357751c04a89a87e6ef1f0cebe5f20957dd112d)", "geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)", diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index fb2f8106ddf..545b0c192b0 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -514,7 +514,6 @@ dependencies = [ name = "util" version = "0.0.1" dependencies = [ - "azure 0.1.0 (git+https://github.com/servo/rust-azure#b357751c04a89a87e6ef1f0cebe5f20957dd112d)", "geom 0.1.0 (git+https://github.com/servo/rust-geom#b001a76e907befaae1d0d6dd259418a22092da86)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)", diff --git a/ports/cef/core.rs b/ports/cef/core.rs index e2c9fe07851..8b139183f41 100644 --- a/ports/cef/core.rs +++ b/ports/cef/core.rs @@ -51,7 +51,6 @@ pub extern "C" fn cef_run_message_loop() { urls.push("http://s27.postimg.org/vqbtrolyr/servo.jpg".to_string()); let opts = opts::Opts { urls: urls, - render_backend: azure::azure_hl::SkiaBackend, n_render_threads: 1, cpu_painting: false, tile_size: 512, |