mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Derive Debug on FontGroup and its components
This commit is contained in:
parent
3d078f7c64
commit
c5ede5851e
10 changed files with 16 additions and 8 deletions
|
@ -45,6 +45,7 @@ impl FontTableMethods for FontTable {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FontHandle {
|
||||
// The font binary. This must stay valid for the lifetime of the font,
|
||||
// if the font is created using FT_Memory_Face.
|
||||
|
|
|
@ -70,7 +70,7 @@ pub type UserPtr = *mut User;
|
|||
|
||||
// WARNING: We need to be careful how we use this struct. See the comment about Rc<> in
|
||||
// FontContextHandle.
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FreeTypeLibraryHandle {
|
||||
pub ctx: FT_Library,
|
||||
mem: FT_Memory,
|
||||
|
@ -98,7 +98,7 @@ impl HeapSizeOf for FreeTypeLibraryHandle {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, HeapSizeOf)]
|
||||
#[derive(Clone, HeapSizeOf, Debug)]
|
||||
pub struct FontContextHandle {
|
||||
// WARNING: FreeTypeLibraryHandle contains raw pointers, is clonable, and also implements
|
||||
// `Drop`. This field needs to be Rc<> to make sure that the `drop` function is only called
|
||||
|
|
|
@ -10,7 +10,7 @@ use string_cache::Atom;
|
|||
/// The identifier is an absolute path, and the bytes
|
||||
/// field is the loaded data that can be passed to
|
||||
/// freetype and azure directly.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub struct FontTemplateData {
|
||||
pub bytes: Vec<u8>,
|
||||
pub identifier: Atom,
|
||||
|
|
|
@ -57,6 +57,7 @@ impl FontTableMethods for FontTable {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FontHandle {
|
||||
pub font_data: Arc<FontTemplateData>,
|
||||
pub ctfont: CTFont,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
use util::mem::HeapSizeOf;
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FontContextHandle {
|
||||
ctx: ()
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ use string_cache::Atom;
|
|||
/// The identifier is a PostScript font name. The
|
||||
/// CTFont object is cached here for use by the
|
||||
/// paint functions that create CGFont references.
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
pub struct FontTemplateData {
|
||||
/// The `CTFont` object, if present. This is cached here so that we don't have to keep creating
|
||||
/// `CTFont` instances over and over. It can always be recreated from the `identifier` and/or
|
||||
|
@ -64,6 +64,7 @@ impl FontTemplateData {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CachedCTFont(Mutex<Option<CTFont>>);
|
||||
|
||||
impl Deref for CachedCTFont {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue