mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Speculatively evaluate paint functions during style.
This commit is contained in:
parent
b35791f86f
commit
936dd3ef63
13 changed files with 279 additions and 52 deletions
|
@ -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}
|
||||
|
|
|
@ -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>);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue