Skip to content

Commit

Permalink
Derive Debug for more font-related types
Browse files Browse the repository at this point in the history
  • Loading branch information
antrik committed Jan 3, 2016
1 parent 7197e7f commit 3c5a3ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/gfx/font_cache_task.rs
Expand Up @@ -77,7 +77,7 @@ impl FontFamily {
}

/// Commands that the FontContext sends to the font cache task.
#[derive(Deserialize, Serialize)]
#[derive(Deserialize, Serialize, Debug)]
pub enum Command {
GetFontTemplate(String, FontTemplateDescriptor, IpcSender<Reply>),
GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender<Reply>),
Expand All @@ -87,7 +87,7 @@ pub enum Command {
}

/// Reply messages sent from the font cache task to the FontContext caller.
#[derive(Deserialize, Serialize)]
#[derive(Deserialize, Serialize, Debug)]
pub enum Reply {
GetFontTemplateReply(Option<Arc<FontTemplateData>>),
}
Expand Down Expand Up @@ -271,7 +271,7 @@ impl FontCache {

/// The public interface to the font cache task, used exclusively by
/// the per-thread/task FontContext structures.
#[derive(Clone, Deserialize, Serialize)]
#[derive(Clone, Deserialize, Serialize, Debug)]
pub struct FontCacheTask {
chan: IpcSender<Command>,
}
Expand Down
5 changes: 5 additions & 0 deletions components/gfx/font_context.rs
Expand Up @@ -44,17 +44,20 @@ fn create_scaled_font(template: &Arc<FontTemplateData>, pt_size: Au) -> ScaledFo

static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h)

#[derive(Debug)]
struct LayoutFontCacheEntry {
family: String,
font: Option<Rc<RefCell<Font>>>,
}

#[derive(Debug)]
struct FallbackFontCacheEntry {
font: Rc<RefCell<Font>>,
}

/// A cached azure font (per paint task) that
/// can be shared by multiple text runs.
#[derive(Debug)]
struct PaintFontCacheEntry {
pt_size: Au,
identifier: Atom,
Expand All @@ -69,6 +72,7 @@ static FONT_CACHE_EPOCH: AtomicUsize = ATOMIC_USIZE_INIT;
/// working with fonts. It is the public API used by the layout and
/// paint code. It talks directly to the font cache task where
/// required.
#[derive(Debug)]
pub struct FontContext {
platform_handle: FontContextHandle,
font_cache_task: FontCacheTask,
Expand Down Expand Up @@ -317,6 +321,7 @@ impl HeapSizeOf for FontContext {
}
}

#[derive(Debug)]
struct LayoutFontGroupCacheKey {
pointer: Arc<SpecifiedFontStyle>,
size: Au,
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties.mako.rs
Expand Up @@ -6115,7 +6115,7 @@ pub mod style_structs {

% for style_struct in STYLE_STRUCTS:
% if style_struct.name == "Font":
#[derive(Clone, HeapSizeOf)]
#[derive(Clone, HeapSizeOf, Debug)]
% else:
#[derive(PartialEq, Clone, HeapSizeOf)]
% endif
Expand Down

0 comments on commit 3c5a3ca

Please sign in to comment.