FontContext: Cache data fetched from the cache thread

Before this change, if we needed to create a Font which we've already
created, but at a new size, then we'd fetch the FontTemplateInfo again.
If the bytes of the font are held in memory, then this could be
expensive as we need to pass those bytes over IPC.
This commit is contained in:
Jon Leighton 2018-04-02 21:49:19 +10:00
parent dc683a1fc9
commit 3025a269ec
4 changed files with 77 additions and 9 deletions

View file

@ -32,7 +32,7 @@ pub struct FontTemplates {
templates: Vec<FontTemplate>,
}
#[derive(Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct FontTemplateInfo {
pub font_template: Arc<FontTemplateData>,
pub font_key: webrender_api::FontKey,