mirror of
https://github.com/servo/servo.git
synced 2025-07-20 22:03:42 +01:00
Do not create a channel for each source in add_font_face_rules
This commit is contained in:
parent
6c5f5d35f5
commit
1621e0679e
1 changed files with 13 additions and 9 deletions
|
@ -357,15 +357,19 @@ fn add_font_face_rules(stylesheet: &Stylesheet,
|
||||||
font_cache_thread: &FontCacheThread,
|
font_cache_thread: &FontCacheThread,
|
||||||
font_cache_sender: &IpcSender<()>,
|
font_cache_sender: &IpcSender<()>,
|
||||||
outstanding_web_fonts_counter: &Arc<AtomicUsize>) {
|
outstanding_web_fonts_counter: &Arc<AtomicUsize>) {
|
||||||
for font_face in stylesheet.effective_rules(&device).font_face() {
|
|
||||||
for source in &font_face.sources {
|
|
||||||
if opts::get().load_webfonts_synchronously {
|
if opts::get().load_webfonts_synchronously {
|
||||||
let (sender, receiver) = ipc::channel().unwrap();
|
let (sender, receiver) = ipc::channel().unwrap();
|
||||||
|
for font_face in stylesheet.effective_rules(&device).font_face() {
|
||||||
|
for source in &font_face.sources {
|
||||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||||
(*source).clone(),
|
(*source).clone(),
|
||||||
sender);
|
sender.clone());
|
||||||
receiver.recv().unwrap();
|
receiver.recv().unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
for font_face in stylesheet.effective_rules(&device).font_face() {
|
||||||
|
for source in &font_face.sources {
|
||||||
outstanding_web_fonts_counter.fetch_add(1, Ordering::SeqCst);
|
outstanding_web_fonts_counter.fetch_add(1, Ordering::SeqCst);
|
||||||
font_cache_thread.add_web_font(font_face.family.clone(),
|
font_cache_thread.add_web_font(font_face.family.clone(),
|
||||||
(*source).clone(),
|
(*source).clone(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue