mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Move util::workqueue to style
This commit is contained in:
parent
b6ca1b9b3b
commit
bf34fdde1f
12 changed files with 30 additions and 23 deletions
|
@ -17,10 +17,10 @@ use std::sync::atomic::{AtomicIsize, Ordering};
|
|||
use style::dom::UnsafeNode;
|
||||
use style::parallel::run_queue_with_custom_work_data_type;
|
||||
use style::parallel::{CHUNK_SIZE, WorkQueueData};
|
||||
use style::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
|
||||
use traversal::AssignBSizes;
|
||||
use traversal::{AssignISizes, BubbleISizes};
|
||||
use util::opts;
|
||||
use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
|
||||
|
||||
pub use style::parallel::traverse_dom;
|
||||
|
||||
|
|
|
@ -110,13 +110,13 @@ use style::refcell::RefCell;
|
|||
use style::selector_matching::USER_OR_USER_AGENT_STYLESHEETS;
|
||||
use style::servo::{Animation, LocalStyleContextCreationInfo, SharedStyleContext, Stylesheet, Stylist};
|
||||
use style::stylesheets::CSSRuleIteratorExt;
|
||||
use style::workqueue::WorkQueue;
|
||||
use url::Url;
|
||||
use util::geometry::MAX_RECT;
|
||||
use util::ipc::OptionalIpcSender;
|
||||
use util::opts;
|
||||
use util::thread;
|
||||
use util::thread_state;
|
||||
use util::workqueue::WorkQueue;
|
||||
|
||||
/// The number of screens we have to traverse before we decide to generate new display lists.
|
||||
const DISPLAY_PORT_THRESHOLD_SIZE_FACTOR: i32 = 4;
|
||||
|
|
7
components/servo/Cargo.lock
generated
7
components/servo/Cargo.lock
generated
|
@ -2230,15 +2230,19 @@ dependencies = [
|
|||
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2456,14 +2460,11 @@ dependencies = [
|
|||
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
|
||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -22,6 +22,7 @@ servo = ["serde", "serde/nightly", "serde_macros", "heapsize", "heapsize_plugin"
|
|||
app_units = "0.2.5"
|
||||
bitflags = "0.7"
|
||||
cssparser = "0.5.5"
|
||||
deque = "0.3.1"
|
||||
encoding = "0.2"
|
||||
euclid = "0.7.1"
|
||||
fnv = "1.0"
|
||||
|
@ -29,9 +30,11 @@ gecko_bindings = {path = "../../ports/geckolib/gecko_bindings", optional = true}
|
|||
heapsize = {version = "0.3.0", optional = true}
|
||||
heapsize_plugin = {version = "0.1.2", optional = true}
|
||||
lazy_static = "0.2"
|
||||
libc = "0.2"
|
||||
log = "0.3.5"
|
||||
matches = "0.1"
|
||||
num-traits = "0.1.32"
|
||||
rand = "0.3"
|
||||
rustc-serialize = "0.3"
|
||||
selectors = "0.6"
|
||||
serde = {version = "0.7.11", optional = true}
|
||||
|
@ -43,5 +46,8 @@ time = "0.1"
|
|||
url = "1.0.0"
|
||||
util = {path = "../util"}
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
kernel32-sys = "0.2"
|
||||
|
||||
[build-dependencies]
|
||||
walkdir = "0.1"
|
||||
|
|
|
@ -40,6 +40,7 @@ extern crate bitflags;
|
|||
extern crate core;
|
||||
#[macro_use]
|
||||
extern crate cssparser;
|
||||
extern crate deque;
|
||||
extern crate encoding;
|
||||
extern crate euclid;
|
||||
extern crate fnv;
|
||||
|
@ -49,12 +50,14 @@ extern crate gecko_bindings;
|
|||
#[allow(unused_extern_crates)]
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[allow(unused_extern_crates)]
|
||||
#[macro_use]
|
||||
extern crate matches;
|
||||
extern crate num_traits;
|
||||
extern crate rand;
|
||||
extern crate rustc_serialize;
|
||||
extern crate selectors;
|
||||
#[cfg(feature = "servo")] extern crate serde;
|
||||
|
@ -95,6 +98,7 @@ pub mod traversal;
|
|||
#[allow(non_camel_case_types)]
|
||||
pub mod values;
|
||||
pub mod viewport;
|
||||
pub mod workqueue;
|
||||
|
||||
/// The CSS properties supported by the style system.
|
||||
// Generated from the properties.mako.rs template by build.rs
|
||||
|
|
|
@ -12,7 +12,7 @@ use dom::{OpaqueNode, TNode, UnsafeNode};
|
|||
use std::mem;
|
||||
use std::sync::atomic::Ordering;
|
||||
use traversal::DomTraversalContext;
|
||||
use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
|
||||
use workqueue::{WorkQueue, WorkUnit, WorkerProxy};
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn static_assertion(node: UnsafeNode) {
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
//! Data associated with queues is simply a pair of unsigned integers. It is expected that a
|
||||
//! higher-level API on top of this could allow safe fork-join parallelism.
|
||||
|
||||
#![allow(unsafe_code)]
|
||||
|
||||
#[cfg(windows)]
|
||||
extern crate kernel32;
|
||||
|
||||
|
@ -16,8 +18,8 @@ use libc::usleep;
|
|||
use rand::{Rng, XorShiftRng, weak_rng};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||
use thread::spawn_named;
|
||||
use thread_state;
|
||||
use util::thread::spawn_named;
|
||||
use util::thread_state;
|
||||
|
||||
/// A unit of work.
|
||||
///
|
|
@ -17,13 +17,11 @@ servo = ["serde", "serde_macros", "backtrace", "ipc-channel", "app_units/plugins
|
|||
app_units = "0.2.5"
|
||||
backtrace = {version = "0.2.1", optional = true}
|
||||
bitflags = "0.7"
|
||||
deque = "0.3.1"
|
||||
euclid = "0.7.1"
|
||||
getopts = "0.2.11"
|
||||
heapsize = "0.3.0"
|
||||
ipc-channel = {git = "https://github.com/servo/ipc-channel", optional = true}
|
||||
lazy_static = "0.2"
|
||||
libc = "0.2"
|
||||
log = "0.3.5"
|
||||
num_cpus = "0.2.2"
|
||||
num-traits = "0.1.32"
|
||||
|
@ -35,6 +33,3 @@ url = "1.0.0"
|
|||
|
||||
[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))'.dependencies]
|
||||
xdg = "2.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
kernel32-sys = "0.2"
|
||||
|
|
|
@ -14,13 +14,11 @@
|
|||
extern crate app_units;
|
||||
#[cfg(feature = "servo")] extern crate backtrace;
|
||||
#[allow(unused_extern_crates)] #[macro_use] extern crate bitflags;
|
||||
extern crate deque;
|
||||
extern crate euclid;
|
||||
extern crate getopts;
|
||||
#[macro_use] extern crate heapsize;
|
||||
#[cfg(feature = "servo")] extern crate ipc_channel;
|
||||
#[allow(unused_extern_crates)] #[macro_use] extern crate lazy_static;
|
||||
extern crate libc;
|
||||
#[macro_use] extern crate log;
|
||||
extern crate num_cpus;
|
||||
extern crate num_traits;
|
||||
|
@ -45,7 +43,6 @@ pub mod str;
|
|||
pub mod thread;
|
||||
pub mod thread_state;
|
||||
pub mod tid;
|
||||
#[allow(unsafe_code)] pub mod workqueue;
|
||||
|
||||
#[cfg(feature = "servo")]
|
||||
#[allow(unsafe_code)]
|
||||
|
|
7
ports/cef/Cargo.lock
generated
7
ports/cef/Cargo.lock
generated
|
@ -2115,15 +2115,19 @@ dependencies = [
|
|||
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2325,14 +2329,11 @@ dependencies = [
|
|||
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.2.3 (git+https://github.com/servo/ipc-channel)",
|
||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
7
ports/geckolib/Cargo.lock
generated
7
ports/geckolib/Cargo.lock
generated
|
@ -450,16 +450,20 @@ dependencies = [
|
|||
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cssparser 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gecko_bindings 0.0.1",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize_plugin 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"selectors 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -562,14 +566,11 @@ dependencies = [
|
|||
"app_units 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"backtrace 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ipc-channel 0.2.4 (git+https://github.com/servo/ipc-channel)",
|
||||
"kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num_cpus 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -14,9 +14,9 @@ use std::sync::{Arc, RwLock};
|
|||
use style::dom::OpaqueNode;
|
||||
use style::media_queries::{Device, MediaType};
|
||||
use style::parallel::WorkQueueData;
|
||||
use style::workqueue::WorkQueue;
|
||||
use util::geometry::ViewportPx;
|
||||
use util::thread_state;
|
||||
use util::workqueue::WorkQueue;
|
||||
|
||||
pub struct PerDocumentStyleData {
|
||||
/// Rule processor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue