mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #9070 - antrik:debug-fonts, r=nox
Derive Debug for more font-related types Needs to pull in newer ipc-channel and azure. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9070) <!-- Reviewable:end -->
This commit is contained in:
commit
ebf4ce8288
6 changed files with 17 additions and 12 deletions
|
@ -80,7 +80,7 @@ impl FontTemplates {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Commands that the FontContext sends to the font cache task.
|
/// Commands that the FontContext sends to the font cache task.
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
pub enum Command {
|
pub enum Command {
|
||||||
GetFontTemplate(FontFamily, FontTemplateDescriptor, IpcSender<Reply>),
|
GetFontTemplate(FontFamily, FontTemplateDescriptor, IpcSender<Reply>),
|
||||||
GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender<Reply>),
|
GetLastResortFontTemplate(FontTemplateDescriptor, IpcSender<Reply>),
|
||||||
|
@ -90,7 +90,7 @@ pub enum Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reply messages sent from the font cache task to the FontContext caller.
|
/// Reply messages sent from the font cache task to the FontContext caller.
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize, Debug)]
|
||||||
pub enum Reply {
|
pub enum Reply {
|
||||||
GetFontTemplateReply(Option<Arc<FontTemplateData>>),
|
GetFontTemplateReply(Option<Arc<FontTemplateData>>),
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ impl FontCache {
|
||||||
|
|
||||||
/// The public interface to the font cache task, used exclusively by
|
/// The public interface to the font cache task, used exclusively by
|
||||||
/// the per-thread/task FontContext structures.
|
/// the per-thread/task FontContext structures.
|
||||||
#[derive(Clone, Deserialize, Serialize)]
|
#[derive(Clone, Deserialize, Serialize, Debug)]
|
||||||
pub struct FontCacheTask {
|
pub struct FontCacheTask {
|
||||||
chan: IpcSender<Command>,
|
chan: IpcSender<Command>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
static SMALL_CAPS_SCALE_FACTOR: f32 = 0.8; // Matches FireFox (see gfxFont.h)
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
struct LayoutFontCacheEntry {
|
struct LayoutFontCacheEntry {
|
||||||
family: String,
|
family: String,
|
||||||
font: Option<Rc<RefCell<Font>>>,
|
font: Option<Rc<RefCell<Font>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
struct FallbackFontCacheEntry {
|
struct FallbackFontCacheEntry {
|
||||||
font: Rc<RefCell<Font>>,
|
font: Rc<RefCell<Font>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A cached azure font (per paint task) that
|
/// A cached azure font (per paint task) that
|
||||||
/// can be shared by multiple text runs.
|
/// can be shared by multiple text runs.
|
||||||
|
#[derive(Debug)]
|
||||||
struct PaintFontCacheEntry {
|
struct PaintFontCacheEntry {
|
||||||
pt_size: Au,
|
pt_size: Au,
|
||||||
identifier: Atom,
|
identifier: Atom,
|
||||||
|
@ -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
|
/// working with fonts. It is the public API used by the layout and
|
||||||
/// paint code. It talks directly to the font cache task where
|
/// paint code. It talks directly to the font cache task where
|
||||||
/// required.
|
/// required.
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct FontContext {
|
pub struct FontContext {
|
||||||
platform_handle: FontContextHandle,
|
platform_handle: FontContextHandle,
|
||||||
font_cache_task: FontCacheTask,
|
font_cache_task: FontCacheTask,
|
||||||
|
@ -316,6 +320,7 @@ impl HeapSizeOf for FontContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
struct LayoutFontGroupCacheKey {
|
struct LayoutFontGroupCacheKey {
|
||||||
pointer: Arc<SpecifiedFontStyle>,
|
pointer: Arc<SpecifiedFontStyle>,
|
||||||
size: Au,
|
size: Au,
|
||||||
|
|
4
components/servo/Cargo.lock
generated
4
components/servo/Cargo.lock
generated
|
@ -92,7 +92,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "azure"
|
name = "azure"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
source = "git+https://github.com/servo/rust-azure#b05ba4bb70aefb319c7f168fc83a9fd04a1aa1ef"
|
source = "git+https://github.com/servo/rust-azure#7662f94f0b8c368134a04edac936328d603c7ad8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"core-graphics 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-graphics 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -872,7 +872,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipc-channel"
|
name = "ipc-channel"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/ipc-channel#6900611d5f00c7405ae886d75841fe37df6bfc38"
|
source = "git+https://github.com/servo/ipc-channel#1b95d5490d7b7f49576577315bdb5b4c834d08d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode 0.4.0 (git+https://github.com/TyOverby/bincode)",
|
"bincode 0.4.0 (git+https://github.com/TyOverby/bincode)",
|
||||||
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -6141,7 +6141,7 @@ pub mod style_structs {
|
||||||
|
|
||||||
% for style_struct in STYLE_STRUCTS:
|
% for style_struct in STYLE_STRUCTS:
|
||||||
% if style_struct.name == "Font":
|
% if style_struct.name == "Font":
|
||||||
#[derive(Clone, HeapSizeOf)]
|
#[derive(Clone, HeapSizeOf, Debug)]
|
||||||
% else:
|
% else:
|
||||||
#[derive(PartialEq, Clone, HeapSizeOf)]
|
#[derive(PartialEq, Clone, HeapSizeOf)]
|
||||||
% endif
|
% endif
|
||||||
|
|
6
ports/cef/Cargo.lock
generated
6
ports/cef/Cargo.lock
generated
|
@ -81,7 +81,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "azure"
|
name = "azure"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
source = "git+https://github.com/servo/rust-azure#b05ba4bb70aefb319c7f168fc83a9fd04a1aa1ef"
|
source = "git+https://github.com/servo/rust-azure#7662f94f0b8c368134a04edac936328d603c7ad8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"core-graphics 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-graphics 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -832,12 +832,12 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipc-channel"
|
name = "ipc-channel"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/ipc-channel#6900611d5f00c7405ae886d75841fe37df6bfc38"
|
source = "git+https://github.com/servo/ipc-channel#1b95d5490d7b7f49576577315bdb5b4c834d08d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode 0.4.0 (git+https://github.com/TyOverby/bincode)",
|
"bincode 0.4.0 (git+https://github.com/TyOverby/bincode)",
|
||||||
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
6
ports/gonk/Cargo.lock
generated
6
ports/gonk/Cargo.lock
generated
|
@ -72,7 +72,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "azure"
|
name = "azure"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
source = "git+https://github.com/servo/rust-azure#b05ba4bb70aefb319c7f168fc83a9fd04a1aa1ef"
|
source = "git+https://github.com/servo/rust-azure#7662f94f0b8c368134a04edac936328d603c7ad8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"core-graphics 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-graphics 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -800,12 +800,12 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ipc-channel"
|
name = "ipc-channel"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/servo/ipc-channel#6900611d5f00c7405ae886d75841fe37df6bfc38"
|
source = "git+https://github.com/servo/ipc-channel#1b95d5490d7b7f49576577315bdb5b4c834d08d0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode 0.4.0 (git+https://github.com/TyOverby/bincode)",
|
"bincode 0.4.0 (git+https://github.com/TyOverby/bincode)",
|
||||||
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rand 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue