Speculatively evaluate paint functions during style.

This commit is contained in:
Alan Jeffrey 2017-07-18 14:57:22 -05:00
parent b35791f86f
commit 936dd3ef63
13 changed files with 279 additions and 52 deletions

View file

@ -10,7 +10,7 @@ name = "style_traits"
path = "lib.rs"
[features]
servo = ["heapsize", "heapsize_derive", "serde", "cssparser/heapsize", "cssparser/serde", "webrender_api"]
servo = ["heapsize", "heapsize_derive", "serde", "servo_atoms", "cssparser/heapsize", "cssparser/serde", "webrender_api"]
gecko = []
[dependencies]
@ -23,3 +23,4 @@ heapsize_derive = {version = "0.1", optional = true}
selectors = { path = "../selectors" }
serde = {version = "1.0", optional = true}
webrender_api = {git = "https://github.com/servo/webrender", optional = true}
servo_atoms = {path = "../atoms", optional = true}

View file

@ -22,11 +22,13 @@ extern crate euclid;
extern crate selectors;
#[cfg(feature = "servo")] #[macro_use] extern crate serde;
#[cfg(feature = "servo")] extern crate webrender_api;
#[cfg(feature = "servo")] extern crate servo_atoms;
#[cfg(feature = "servo")] pub use webrender_api::DevicePixel;
use cssparser::{CowRcStr, Token};
use selectors::parser::SelectorParseError;
#[cfg(feature = "servo")] use servo_atoms::Atom;
/// One hardware pixel.
///
@ -184,3 +186,9 @@ impl ParsingMode {
}
}
#[cfg(feature = "servo")]
/// Speculatively execute paint code in the worklet thread pool.
pub trait SpeculativePainter: Send + Sync {
/// https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image
fn speculatively_draw_a_paint_image(&self, properties: Vec<(Atom, String)>, arguments: Vec<String>);
}