aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_thread.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-06-07 03:50:18 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-06-07 03:50:18 -0500
commitb64b21ace0e9b3639906c9dc988c66ea596f3d88 (patch)
tree8bb932141aaf97ae2d3e43f877aa2277d3469dfe /components/layout/layout_thread.rs
parent0f1f99a4bf3be2f695b402e8676c3b0b935cbc5b (diff)
parent64b34d516215985827249529a4977522a0f6be8e (diff)
downloadservo-b64b21ace0e9b3639906c9dc988c66ea596f3d88.tar.gz
servo-b64b21ace0e9b3639906c9dc988c66ea596f3d88.zip
Auto merge of #11565 - nox:fonts, r=metajack
Introduce FontFaceRules::effective_sources() <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11565) <!-- Reviewable:end -->
Diffstat (limited to 'components/layout/layout_thread.rs')
-rw-r--r--components/layout/layout_thread.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/components/layout/layout_thread.rs b/components/layout/layout_thread.rs
index b48813a0c31..6307e5a79fc 100644
--- a/components/layout/layout_thread.rs
+++ b/components/layout/layout_thread.rs
@@ -355,19 +355,23 @@ fn add_font_face_rules(stylesheet: &Stylesheet,
font_cache_thread: &FontCacheThread,
font_cache_sender: &IpcSender<()>,
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 {
- let (sender, receiver) = ipc::channel().unwrap();
+ if opts::get().load_webfonts_synchronously {
+ let (sender, receiver) = ipc::channel().unwrap();
+ for font_face in stylesheet.effective_rules(&device).font_face() {
+ for source in font_face.effective_sources() {
font_cache_thread.add_web_font(font_face.family.clone(),
- (*source).clone(),
- sender);
+ (*source).clone(),
+ sender.clone());
receiver.recv().unwrap();
- } else {
+ }
+ }
+ } else {
+ for font_face in stylesheet.effective_rules(&device).font_face() {
+ for source in font_face.effective_sources() {
outstanding_web_fonts_counter.fetch_add(1, Ordering::SeqCst);
font_cache_thread.add_web_font(font_face.family.clone(),
- (*source).clone(),
- (*font_cache_sender).clone());
+ (*source).clone(),
+ (*font_cache_sender).clone());
}
}
}