pub(crate) trait CanvasContext {
type ID;
// Required methods
fn context_id(&self) -> Self::ID;
fn canvas(
&self,
) -> Option<HTMLCanvasElementOrOffscreenCanvas<DomTypeHolder>>;
fn resize(&self);
fn reset_bitmap(&self);
fn get_image_data(&self) -> Option<Snapshot>;
// Provided methods
fn origin_is_clean(&self) -> bool { ... }
fn size(&self) -> Size2D<u32> { ... }
fn mark_as_dirty(&self) { ... }
fn update_rendering(&self) { ... }
fn onscreen(&self) -> bool { ... }
}
Required Associated Types§
Required Methods§
fn context_id(&self) -> Self::ID
fn canvas(&self) -> Option<HTMLCanvasElementOrOffscreenCanvas<DomTypeHolder>>
fn resize(&self)
fn reset_bitmap(&self)
Sourcefn get_image_data(&self) -> Option<Snapshot>
fn get_image_data(&self) -> Option<Snapshot>
Returns none if area of canvas is zero.
In case of other errors it returns cleared snapshot