mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +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
|
@ -66,6 +66,7 @@ use std::fmt;
|
|||
use std::sync::Arc;
|
||||
use std::sync::mpsc::{Receiver, Sender, RecvTimeoutError};
|
||||
use style_traits::CSSPixel;
|
||||
use style_traits::SpeculativePainter;
|
||||
use webdriver_msg::{LoadStatus, WebDriverScriptCommand};
|
||||
use webrender_api::{ClipId, DevicePixel, ImageKey};
|
||||
use webvr_traits::{WebVREvent, WebVRMsg};
|
||||
|
@ -817,7 +818,7 @@ impl From<RecvTimeoutError> for PaintWorkletError {
|
|||
}
|
||||
|
||||
/// Execute paint code in the worklet thread pool.
|
||||
pub trait Painter: Sync + Send {
|
||||
pub trait Painter: SpeculativePainter {
|
||||
/// https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image
|
||||
fn draw_a_paint_image(&self,
|
||||
size: TypedSize2D<f32, CSSPixel>,
|
||||
|
@ -829,7 +830,7 @@ pub trait Painter: Sync + Send {
|
|||
|
||||
/// The result of executing paint code: the image together with any image URLs that need to be loaded.
|
||||
/// TODO: this should return a WR display list. https://github.com/servo/servo/issues/17497
|
||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||
#[derive(Debug, Deserialize, Serialize, Clone, HeapSizeOf)]
|
||||
pub struct DrawAPaintImageResult {
|
||||
/// The image height
|
||||
pub width: u32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue