mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue