mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
auto merge of #1012 : deokjinkim/servo/glyph_advance_cache, r=ILyoan
#1008 has unnecessary code change. So I want to revert this code.
This commit is contained in:
commit
d99e69e244
4 changed files with 4 additions and 4 deletions
|
@ -49,7 +49,7 @@ pub trait FontHandleMethods {
|
||||||
fn clone_with_style(&self, fctx: &FontContextHandle, style: &UsedFontStyle)
|
fn clone_with_style(&self, fctx: &FontContextHandle, style: &UsedFontStyle)
|
||||||
-> Result<FontHandle, ()>;
|
-> Result<FontHandle, ()>;
|
||||||
fn glyph_index(&self, codepoint: char) -> Option<GlyphIndex>;
|
fn glyph_index(&self, codepoint: char) -> Option<GlyphIndex>;
|
||||||
fn glyph_h_advance(&mut self, GlyphIndex) -> Option<FractionalPixel>;
|
fn glyph_h_advance(&self, GlyphIndex) -> Option<FractionalPixel>;
|
||||||
fn get_metrics(&self) -> FontMetrics;
|
fn get_metrics(&self) -> FontMetrics;
|
||||||
fn get_table_for_tag(&self, FontTableTag) -> Option<FontTable>;
|
fn get_table_for_tag(&self, FontTableTag) -> Option<FontTable>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,7 +198,7 @@ impl FontHandleMethods for FontHandle {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[fixed_stack_segment]
|
#[fixed_stack_segment]
|
||||||
fn glyph_h_advance(&mut self,
|
fn glyph_h_advance(&self,
|
||||||
glyph: GlyphIndex) -> Option<FractionalPixel> {
|
glyph: GlyphIndex) -> Option<FractionalPixel> {
|
||||||
assert!(self.face.is_not_null());
|
assert!(self.face.is_not_null());
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -198,7 +198,7 @@ impl FontHandleMethods for FontHandle {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[fixed_stack_segment]
|
#[fixed_stack_segment]
|
||||||
fn glyph_h_advance(&mut self,
|
fn glyph_h_advance(&self,
|
||||||
glyph: GlyphIndex) -> Option<FractionalPixel> {
|
glyph: GlyphIndex) -> Option<FractionalPixel> {
|
||||||
assert!(self.face.is_not_null());
|
assert!(self.face.is_not_null());
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -147,7 +147,7 @@ impl FontHandleMethods for FontHandle {
|
||||||
return Some(glyphs[0] as GlyphIndex);
|
return Some(glyphs[0] as GlyphIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn glyph_h_advance(&mut self, glyph: GlyphIndex) -> Option<FractionalPixel> {
|
fn glyph_h_advance(&self, glyph: GlyphIndex) -> Option<FractionalPixel> {
|
||||||
let glyphs = [glyph as CGGlyph];
|
let glyphs = [glyph as CGGlyph];
|
||||||
let advance = self.ctfont.get_advances_for_glyphs(kCTFontDefaultOrientation,
|
let advance = self.ctfont.get_advances_for_glyphs(kCTFontDefaultOrientation,
|
||||||
&glyphs[0],
|
&glyphs[0],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue