aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/gecko')
-rw-r--r--components/style/gecko/data.rs15
-rw-r--r--components/style/gecko/wrapper.rs3
2 files changed, 7 insertions, 11 deletions
diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs
index 1cc360fdeb8..2f6ed96c71f 100644
--- a/components/style/gecko/data.rs
+++ b/components/style/gecko/data.rs
@@ -4,15 +4,14 @@
use animation::Animation;
use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
-use context::SharedStyleContext;
use dom::OpaqueNode;
use euclid::size::TypedSize2D;
use gecko_bindings::bindings::RawServoStyleSet;
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
use media_queries::{Device, MediaType};
use num_cpus;
-use parallel::WorkQueueData;
use parking_lot::RwLock;
+use rayon;
use selector_matching::Stylist;
use std::cmp;
use std::collections::HashMap;
@@ -21,8 +20,6 @@ use std::sync::Arc;
use std::sync::mpsc::{Receiver, Sender, channel};
use style_traits::ViewportPx;
use stylesheets::Stylesheet;
-use thread_state;
-use workqueue::WorkQueue;
pub struct PerDocumentStyleDataImpl {
/// Rule processor.
@@ -41,7 +38,7 @@ pub struct PerDocumentStyleDataImpl {
pub expired_animations: Arc<RwLock<HashMap<OpaqueNode, Vec<Animation>>>>,
// FIXME(bholley): This shouldn't be per-document.
- pub work_queue: Option<WorkQueue<SharedStyleContext, WorkQueueData>>,
+ pub work_queue: Option<rayon::ThreadPool>,
pub num_threads: usize,
}
@@ -76,7 +73,9 @@ impl PerDocumentStyleData {
work_queue: if *NUM_THREADS <= 1 {
None
} else {
- WorkQueue::new("StyleWorker", thread_state::LAYOUT, *NUM_THREADS).ok()
+ let configuration =
+ rayon::Configuration::new().set_num_threads(*NUM_THREADS);
+ rayon::ThreadPool::new(configuration).ok()
},
num_threads: *NUM_THREADS,
}))
@@ -112,8 +111,6 @@ unsafe impl HasBoxFFI for PerDocumentStyleData {}
impl Drop for PerDocumentStyleDataImpl {
fn drop(&mut self) {
- if let Some(ref mut queue) = self.work_queue {
- queue.shutdown();
- }
+ let _ = self.work_queue.take();
}
}
diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs
index 9adac5f269f..cc40f22ae97 100644
--- a/components/style/gecko/wrapper.rs
+++ b/components/style/gecko/wrapper.rs
@@ -30,7 +30,6 @@ use gecko_bindings::bindings::Gecko_StoreStyleDifference;
use gecko_bindings::structs;
use gecko_bindings::structs::{NODE_HAS_DIRTY_DESCENDANTS_FOR_SERVO, NODE_IS_DIRTY_FOR_SERVO};
use gecko_bindings::structs::{nsIAtom, nsIContent, nsStyleContext};
-use libc::uintptr_t;
use parking_lot::RwLock;
use parser::ParserContextExtraData;
use properties::{ComputedValues, parse_style_attribute};
@@ -114,7 +113,7 @@ impl<'ln> TNode for GeckoNode<'ln> {
}
fn opaque(&self) -> OpaqueNode {
- let ptr: uintptr_t = self.0 as *const _ as uintptr_t;
+ let ptr: usize = self.0 as *const _ as usize;
OpaqueNode(ptr)
}