#[repr(C)]pub struct PaintWorkletGlobalScope {
worklet_global: WorkletGlobalScope,
image_cache: Arc<dyn ImageCache>,
paint_definitions: DomRefCell<HashMapTracedValues<Atom, Box<PaintDefinition>>>,
paint_class_instances: DomRefCell<HashMapTracedValues<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<HashMapTracedValues<Atom, Box<PaintDefinition>>>
§paint_class_instances: DomRefCell<HashMapTracedValues<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 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 for PaintWorkletGlobalScope
impl PartialEq for PaintWorkletGlobalScope
source§impl Traceable for PaintWorkletGlobalScope
impl Traceable for PaintWorkletGlobalScope
impl DerivedFrom<EventTarget> for PaintWorkletGlobalScope
impl DerivedFrom<GlobalScope> for PaintWorkletGlobalScope
impl DerivedFrom<WorkletGlobalScope> for PaintWorkletGlobalScope
impl Eq for PaintWorkletGlobalScope
Auto Trait Implementations§
impl !Freeze for PaintWorkletGlobalScope
impl !RefUnwindSafe for PaintWorkletGlobalScope
impl !Send for PaintWorkletGlobalScope
impl !Sync for PaintWorkletGlobalScope
impl Unpin for PaintWorkletGlobalScope
impl !UnwindSafe for PaintWorkletGlobalScope
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more