Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8.

This commit is contained in:
Simon Sapin 2015-04-23 00:14:02 +02:00 committed by Josh Matthews
parent 7b87085c18
commit ef8edd4e87
168 changed files with 2247 additions and 2408 deletions

View file

@ -61,7 +61,6 @@ git = "https://github.com/servo/rust-core-text"
[dependencies.skia]
git = "https://github.com/servo/skia"
branch = "upstream-2014-06-16"
[dependencies.script_traits]
path = "../script_traits"

View file

@ -40,7 +40,7 @@ use util::linked_list::prepend_from;
use util::geometry::{self, Au, MAX_RECT, ZERO_RECT};
use util::mem::HeapSizeOf;
use util::range::Range;
use util::smallvec::{SmallVec, SmallVec8};
use util::smallvec::SmallVec8;
use std::fmt;
use std::slice::Iter;
use std::sync::Arc;
@ -305,8 +305,7 @@ impl StackingContext {
for kid in display_list.children.iter() {
positioned_children.push((*kid).clone());
}
positioned_children.as_slice_mut()
.sort_by(|this, other| this.z_index.cmp(&other.z_index));
positioned_children.sort_by(|this, other| this.z_index.cmp(&other.z_index));
// Set up our clip rect and transform.
let old_transform = paint_subcontext.draw_target.get_transform();

View file

@ -10,7 +10,6 @@ use azure::azure_hl::{FilterNode, FilterType, LinearTransferAttribute, LinearTra
use azure::azure_hl::{Matrix5x4, TableTransferAttribute, TableTransferInput};
use azure::azure_hl::{GaussianBlurAttribute, GaussianBlurInput};
use std::num::Float;
use style::computed_values::filter;
use util::geometry::Au;

View file

@ -9,7 +9,7 @@ use std::slice;
use std::rc::Rc;
use std::cell::RefCell;
use util::cache::HashCache;
use util::smallvec::{SmallVec, SmallVec8};
use util::smallvec::SmallVec8;
use style::computed_values::{font_stretch, font_variant, font_weight};
use style::properties::style_structs::Font as FontStyle;
use std::sync::Arc;
@ -185,7 +185,7 @@ impl Font {
pub fn glyph_index(&self, codepoint: char) -> Option<GlyphId> {
let codepoint = match self.variant {
font_variant::T::small_caps => codepoint.to_uppercase(),
font_variant::T::small_caps => codepoint.to_uppercase().next().unwrap(), //FIXME: #5938
font_variant::T::normal => codepoint,
};
self.handle.glyph_index(codepoint)
@ -222,7 +222,8 @@ impl FontGroup {
assert!(self.fonts.len() > 0);
// TODO(Issue #177): Actually fall back through the FontGroup when a font is unsuitable.
TextRun::new(&mut *self.fonts.get(0).borrow_mut(), text.clone(), options)
let mut font_borrow = self.fonts[0].borrow_mut();
TextRun::new(&mut *font_borrow, text.clone(), options)
}
}

View file

@ -191,7 +191,7 @@ impl FontCache {
let s = self.local_families.get_mut(family_name).unwrap();
if s.templates.len() == 0 {
get_variations_for_family(&family_name, |path| {
get_variations_for_family(family_name, |path| {
s.add_template(&path, None);
});
}

View file

@ -15,7 +15,7 @@ use platform::font_template::FontTemplateData;
use util::cache::HashCache;
use util::fnv::FnvHasher;
use util::geometry::Au;
use util::smallvec::{SmallVec, SmallVec8};
use util::smallvec::SmallVec8;
use std::borrow::{self, ToOwned};
use std::cell::RefCell;
@ -45,7 +45,7 @@ fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: Au) -> ScaledFo
ScaledFont::new(BackendType::Skia, &cgfont, pt_size.to_subpx() as AzFloat)
}
static SMALL_CAPS_SCALE_FACTOR: f64 = 0.8; // Matches FireFox (see gfxFont.h)
static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h)
struct LayoutFontCacheEntry {
family: String,
@ -160,7 +160,7 @@ impl FontContext {
let mut fonts = SmallVec8::new();
for family in style.font_family.iter() {
for family in style.font_family.0.iter() {
// GWTODO: Check on real pages if this is faster as Vec() or HashMap().
let mut cache_hit = false;
for cached_font_entry in self.layout_font_cache.iter() {

View file

@ -6,12 +6,10 @@
#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(io))]
#![feature(plugin)]
#![feature(rustc_private)]
#![feature(std_misc)]
#![feature(unicode)]
#![feature(unsafe_destructor)]
#![feature(str_char)]
#![plugin(plugins)]
@ -28,8 +26,7 @@ extern crate stb_image;
extern crate png;
extern crate profile_traits;
extern crate script_traits;
extern crate "rustc-serialize" as rustc_serialize;
extern crate unicode;
extern crate rustc_serialize;
extern crate net_traits;
#[macro_use]
extern crate util;

View file

@ -34,7 +34,6 @@ use png::PixelsByColorType;
use std::default::Default;
use std::f32;
use std::mem;
use std::num::Float;
use std::ptr;
use std::sync::Arc;
use style::computed_values::{border_style, filter, image_rendering, mix_blend_mode};

View file

@ -33,7 +33,6 @@ use std::sync::Arc;
use std::sync::mpsc::{Receiver, Sender, channel};
use util::geometry::{Au, ZERO_POINT};
use util::opts;
use util::smallvec::SmallVec;
use util::task::spawn_named_with_send_on_failure;
use util::task_state;
use util::task::spawn_named;

View file

@ -28,7 +28,6 @@ use freetype::tt_os2::TT_OS2;
use libc::c_char;
use std::mem;
use std::num::Float;
use std::ptr;
use std::sync::Arc;
@ -56,7 +55,6 @@ pub struct FontHandle {
pub handle: FontContextHandle
}
#[unsafe_destructor]
impl Drop for FontHandle {
fn drop(&mut self) {
assert!(!self.face.is_null());

View file

@ -27,7 +27,6 @@ use core_text::font::CTFont;
use core_text::font_descriptor::{SymbolicTraitAccessors, TraitAccessors};
use core_text::font_descriptor::{kCTFontDefaultOrientation};
use std::num::Float;
use std::ptr;
use std::sync::Arc;

View file

@ -34,7 +34,7 @@ impl FontTemplateData {
}
},
None => {
Some(core_text::font::new_from_name(&identifier, 0.0).unwrap())
Some(core_text::font::new_from_name(identifier, 0.0).unwrap())
}
};

View file

@ -6,8 +6,6 @@ use geom::point::Point2D;
use std::cmp::{Ordering, PartialOrd};
use std::iter::repeat;
use std::mem;
use std::num::{ToPrimitive, NumCast};
use std::ops::{Add, Sub, Mul, Neg, Div, Rem, BitAnd, BitOr, BitXor, Shl, Shr, Not};
use std::u16;
use std::vec::Vec;
use util::geometry::Au;
@ -156,10 +154,9 @@ fn is_simple_glyph_id(id: GlyphId) -> bool {
}
fn is_simple_advance(advance: Au) -> bool {
match advance.to_u32() {
Some(unsigned_au) =>
(unsigned_au & (GLYPH_ADVANCE_MASK >> GLYPH_ADVANCE_SHIFT)) == unsigned_au,
None => false
advance >= Au(0) && {
let unsigned_au = advance.0 as u32;
(unsigned_au & (GLYPH_ADVANCE_MASK >> GLYPH_ADVANCE_SHIFT)) == unsigned_au
}
}
@ -171,7 +168,7 @@ impl GlyphEntry {
// getter methods
#[inline(always)]
fn advance(&self) -> Au {
NumCast::from((self.value & GLYPH_ADVANCE_MASK) >> GLYPH_ADVANCE_SHIFT).unwrap()
Au(((self.value & GLYPH_ADVANCE_MASK) >> GLYPH_ADVANCE_SHIFT) as i32)
}
fn id(&self) -> GlyphId {
@ -731,7 +728,7 @@ impl<'a> GlyphStore {
// FIXME(pcwalton): This can overflow for very large font-sizes.
let advance =
((entry.value & GLYPH_ADVANCE_MASK) >> GLYPH_ADVANCE_SHIFT) +
Au::from_frac_px(space).to_u32().unwrap();
Au::from_frac_px(space).0 as u32;
entry.value = (entry.value & !GLYPH_ADVANCE_MASK) |
(advance << GLYPH_ADVANCE_SHIFT);
}

View file

@ -154,7 +154,6 @@ pub struct Shaper {
font_and_shaping_options: Box<FontAndShapingOptions>,
}
#[unsafe_destructor]
impl Drop for Shaper {
fn drop(&mut self) {
unsafe {