script::canvas_context

Trait CanvasContext

Source
pub(crate) trait CanvasContext {
    type ID;

    // Required methods
    fn context_id(&self) -> Self::ID;
    fn canvas(&self) -> HTMLCanvasElementOrOffscreenCanvas<DomTypeHolder>;
    fn resize(&self);
    fn get_image_data_as_shared_memory(&self) -> Option<IpcSharedMemory>;

    // Provided methods
    fn get_image_data(&self) -> Option<Vec<u8>> { ... }
    fn origin_is_clean(&self) -> bool { ... }
    fn size(&self) -> Size2D<u64> { ... }
    fn mark_as_dirty(&self) { ... }
    fn update_rendering(&self) { ... }
    fn onscreen(&self) -> bool { ... }
}

Required Associated Types§

Required Methods§

Provided Methods§

Implementors§