Merge branch 'master' of https://github.com/servo/servo into font_style

This commit is contained in:
Deokjin Kim 2015-01-20 11:02:41 +09:00
commit ee0ce0d8f4
55 changed files with 617 additions and 357 deletions

View file

@ -8,6 +8,7 @@ use servo_util::range::{Range, RangeIndex, EachIndex};
use servo_util::geometry::Au;
use std::cmp::PartialOrd;
use std::iter::repeat;
use std::num::NumCast;
use std::mem;
use std::u16;
@ -526,7 +527,8 @@ impl<'a> GlyphStore {
assert!(length > 0);
GlyphStore {
entry_buffer: Vec::from_elem(length as uint, GlyphEntry::initial()),
entry_buffer: repeat(GlyphEntry::initial()).take(length as uint)
.collect(),
detail_store: DetailedGlyphStore::new(),
is_whitespace: is_whitespace,
}

View file

@ -43,6 +43,7 @@ use libc::{c_uint, c_int, c_void, c_char};
use servo_util::geometry::Au;
use servo_util::range::Range;
use std::char;
use std::iter::repeat;
use std::mem;
use std::cmp;
use std::ptr;
@ -295,9 +296,10 @@ impl Shaper {
// fast path: all chars are single-byte.
if byte_max == char_max {
byte_to_glyph = Vec::from_elem(byte_max as uint, NO_GLYPH);
byte_to_glyph = repeat(NO_GLYPH).take(byte_max as uint).collect();
} else {
byte_to_glyph = Vec::from_elem(byte_max as uint, CONTINUATION_BYTE);
byte_to_glyph = repeat(CONTINUATION_BYTE).take(byte_max as uint)
.collect();
for (i, _) in text.char_indices() {
byte_to_glyph[i] = NO_GLYPH;
}