mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
fonts: Simplify FontContext
in two ways that affect the unit test (#33541)
This is done by no longer forwarding compositor-bound messages through SystemFontService and making `FontContext` non-generic: - Messages from the `FontContext` to the `Compositor` no longer need to be forwarded through the `SystemFontService`. Instead send these messages directly through the script IPC channel to the `Compositor`. - Instead of adding a mock `SystemFontServiceProxy`, simply implement a mock `SystemFontService` on the other side of an IPC channel in the `font_context` unit test. This allows making `FontContext` non-generic, greatly simplifying the code. The extra complexity moves into the unit test. These changes necessitate adding a new kind of `FontIdentifier`, `FontIdentifier::Mock` due to the fact that local fonts have platform-specific identifiers. This avoids having to pretend like the system font service can have web fonts -- which was always a bit of a hack. These two changes are combined into one PR because they both require extensive and similar chages in the font_context unit test which dependended on the details of both of them. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
1daa0b4fc7
commit
ac567645a7
25 changed files with 482 additions and 425 deletions
|
@ -141,7 +141,7 @@ pub struct CompositionPipeline {
|
|||
pub enum ForwardedToCompositorMsg {
|
||||
Layout(ScriptToCompositorMsg),
|
||||
Net(NetToCompositorMsg),
|
||||
Font(FontToCompositorMsg),
|
||||
SystemFontService(FontToCompositorMsg),
|
||||
Canvas(CanvasToCompositorMsg),
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,9 @@ impl Debug for ForwardedToCompositorMsg {
|
|||
match self {
|
||||
ForwardedToCompositorMsg::Layout(_) => write!(f, "Layout(ScriptToCompositorMsg)"),
|
||||
ForwardedToCompositorMsg::Net(_) => write!(f, "Net(NetToCompositorMsg)"),
|
||||
ForwardedToCompositorMsg::Font(_) => write!(f, "Font(FontToCompositorMsg)"),
|
||||
ForwardedToCompositorMsg::SystemFontService(_) => {
|
||||
write!(f, "SystemFontService(FontToCompositorMsg)")
|
||||
},
|
||||
ForwardedToCompositorMsg::Canvas(_) => write!(f, "Canvas(CanvasToCompositorMsg)"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue