#[repr(C)]pub struct PaintWorkletGlobalScope {
worklet_global: WorkletGlobalScope,
image_cache: Arc<dyn ImageCache>,
paint_definitions: DomRefCell<HashMap<Atom, Box<PaintDefinition>>>,
paint_class_instances: DomRefCell<HashMap<Atom, Box<Heap<JSVal>>>>,
cached_name: DomRefCell<Atom>,
cached_size: Cell<Size2D<f32, CSSPixel>>,
cached_device_pixel_ratio: Cell<Scale<f32, CSSPixel, DevicePixel>>,
cached_properties: DomRefCell<Vec<(Atom, String)>>,
cached_arguments: DomRefCell<Vec<String>>,
cached_result: DomRefCell<DrawAPaintImageResult>,
}
Expand description
Fields§
§worklet_global: WorkletGlobalScope
The worklet global for this object
image_cache: Arc<dyn ImageCache>
The image cache
paint_definitions: DomRefCell<HashMap<Atom, Box<PaintDefinition>>>
§paint_class_instances: DomRefCell<HashMap<Atom, Box<Heap<JSVal>>>>
§cached_name: DomRefCell<Atom>
The most recent name the worklet was called with
cached_size: Cell<Size2D<f32, CSSPixel>>
The most recent size the worklet was drawn at
cached_device_pixel_ratio: Cell<Scale<f32, CSSPixel, DevicePixel>>
The most recent device pixel ratio the worklet was drawn at
cached_properties: DomRefCell<Vec<(Atom, String)>>
The most recent properties the worklet was drawn at
cached_arguments: DomRefCell<Vec<String>>
The most recent arguments the worklet was drawn at
cached_result: DomRefCell<DrawAPaintImageResult>
The most recent result
Implementations§
source§impl PaintWorkletGlobalScope
impl PaintWorkletGlobalScope
fn __assert_parent_type(&self)
source§impl PaintWorkletGlobalScope
impl PaintWorkletGlobalScope
pub fn new(
runtime: &Runtime,
pipeline_id: PipelineId,
base_url: ServoUrl,
executor: WorkletExecutor,
init: &WorkletGlobalScopeInit
) -> Root<Dom<PaintWorkletGlobalScope>>
pub fn image_cache(&self) -> Arc<dyn ImageCache>
pub fn perform_a_worklet_task(&self, task: PaintWorkletTask)
sourcefn draw_a_paint_image(
&self,
name: &Atom,
size_in_px: Size2D<f32, CSSPixel>,
device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
properties: &StylePropertyMapReadOnly,
arguments: &[String]
) -> DrawAPaintImageResult
fn draw_a_paint_image(
&self,
name: &Atom,
size_in_px: Size2D<f32, CSSPixel>,
device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
properties: &StylePropertyMapReadOnly,
arguments: &[String]
) -> DrawAPaintImageResult
sourcefn invoke_a_paint_callback(
&self,
name: &Atom,
size_in_px: Size2D<f32, CSSPixel>,
size_in_dpx: Size2D<u32, DevicePixel>,
device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
properties: &StylePropertyMapReadOnly,
arguments: &[String]
) -> DrawAPaintImageResult
fn invoke_a_paint_callback(
&self,
name: &Atom,
size_in_px: Size2D<f32, CSSPixel>,
size_in_dpx: Size2D<u32, DevicePixel>,
device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
properties: &StylePropertyMapReadOnly,
arguments: &[String]
) -> DrawAPaintImageResult
fn invalid_image(
&self,
size: Size2D<u32, DevicePixel>,
missing_image_urls: Vec<ServoUrl>
) -> DrawAPaintImageResult
fn painter(&self, name: Atom) -> Box<dyn Painter>
Trait Implementations§
source§impl Castable for PaintWorkletGlobalScope
impl Castable for PaintWorkletGlobalScope
source§impl DomObject for PaintWorkletGlobalScope
impl DomObject for PaintWorkletGlobalScope
source§impl HasParent for PaintWorkletGlobalScope
impl HasParent for PaintWorkletGlobalScope
source§fn as_parent(&self) -> &WorkletGlobalScope
fn as_parent(&self) -> &WorkletGlobalScope
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = WorkletGlobalScope
source§impl MallocSizeOf for PaintWorkletGlobalScope
impl MallocSizeOf for PaintWorkletGlobalScope
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl MutDomObject for PaintWorkletGlobalScope
impl MutDomObject for PaintWorkletGlobalScope
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
source§impl PaintWorkletGlobalScopeMethods for PaintWorkletGlobalScope
impl PaintWorkletGlobalScopeMethods for PaintWorkletGlobalScope
source§fn RegisterPaint(
&self,
name: DOMString,
paint_ctor: Rc<VoidFunction>
) -> Result<(), Error>
fn RegisterPaint(
&self,
name: DOMString,
paint_ctor: Rc<VoidFunction>
) -> Result<(), Error>
source§fn Sleep(&self, ms: u64)
fn Sleep(&self, ms: u64)
This is a blocking sleep function available in the paint worklet global scope behind the dom.worklet.enabled + dom.worklet.blockingsleep.enabled prefs. It is to be used only for testing, e.g., timeouts, where otherwise one would need busy waiting to make sure a certain timeout is triggered. check-tidy: no specs after this line
source§impl PartialEq<PaintWorkletGlobalScope> for PaintWorkletGlobalScope
impl PartialEq<PaintWorkletGlobalScope> for PaintWorkletGlobalScope
source§fn eq(&self, other: &PaintWorkletGlobalScope) -> bool
fn eq(&self, other: &PaintWorkletGlobalScope) -> bool
self
and other
values to be equal, and is used
by ==
.