Remove unused FontShapingOptions field from Shaper

This commit is contained in:
Matt Brubeck 2016-05-23 10:51:46 -07:00
parent 3c1b8e10c4
commit 7bf6a41553
2 changed files with 12 additions and 35 deletions

View file

@ -172,7 +172,7 @@ struct ShapeCacheEntry {
impl Font {
pub fn shape_text(&mut self, text: &str, options: &ShapingOptions) -> Arc<GlyphStore> {
self.make_shaper(options);
self.make_shaper();
//FIXME: find the equivalent of Equiv and the old ShapeCacheEntryRef
let shaper = &self.shaper;
@ -198,16 +198,10 @@ impl Font {
})
}
fn make_shaper<'a>(&'a mut self, options: &ShapingOptions) -> &'a Shaper {
// fast path: already created a shaper
if let Some(ref mut shaper) = self.shaper {
shaper.set_options(options);
return shaper
fn make_shaper(&mut self) {
if self.shaper.is_none() {
self.shaper = Some(Shaper::new(self));
}
let shaper = Shaper::new(self, options);
self.shaper = Some(shaper);
self.shaper.as_ref().unwrap()
}
pub fn table_for_tag(&self, tag: FontTableTag) -> Option<FontTable> {