mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Remove render backend option as it doesn't work and confuses people.
This commit is contained in:
parent
c123f75558
commit
b816550a17
10 changed files with 16 additions and 46 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -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)",
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
1
ports/android/glut_app/Cargo.lock
generated
1
ports/android/glut_app/Cargo.lock
generated
|
@ -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)",
|
||||
|
|
1
ports/cef/Cargo.lock
generated
1
ports/cef/Cargo.lock
generated
|
@ -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)",
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue