pub struct DrawContext { /* private fields */ }Implementations§
Source§impl DrawContext
impl DrawContext
pub fn new(canvas_ptr: usize) -> Self
pub fn flush(&self)
pub fn save(&self)
pub fn restore(&self)
pub fn translate(&self, x: f32, y: f32)
pub fn scale(&self, sx: f32, sy: f32)
pub fn rotate(&self, degrees: f32)
pub fn clip_rect(&self, x: f32, y: f32, w: f32, h: f32)
pub fn clip_round_rect( &self, x: f32, y: f32, w: f32, h: f32, tl: f32, tr: f32, br: f32, bl: f32, )
pub fn draw_rect(&self, x: f32, y: f32, w: f32, h: f32, paint: Paint)
pub fn draw_circle(&self, cx: f32, cy: f32, radius: f32, paint: Paint)
pub fn draw_line( &self, x1: f32, y1: f32, x2: f32, y2: f32, color: u32, stroke_width: f32, )
pub fn draw_round_rect( &self, x: f32, y: f32, w: f32, h: f32, rx: f32, ry: f32, paint: Paint, )
pub fn draw_path(&self, path: &Path, paint: Paint)
pub fn draw_text_node<T: Node>(&self, node: &T, x: f32, y: f32)
pub fn draw_text_layout(&self, layout: &TextLayout, x: f32, y: f32)
pub fn draw_dynamic_text_layout( &self, layout: &DynamicTextLayout, x: f32, y: f32, )
pub fn draw_image(&self, texture_id: u32, x: f32, y: f32, w: f32, h: f32)
pub fn draw_image_sampling( &self, texture_id: u32, x: f32, y: f32, w: f32, h: f32, sampling: ImageSampling, )
pub fn draw_svg(&self, svg_id: u32, x: f32, y: f32, w: f32, h: f32)
Trait Implementations§
Source§impl Clone for DrawContext
impl Clone for DrawContext
Source§fn clone(&self) -> DrawContext
fn clone(&self) -> DrawContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for DrawContext
impl Default for DrawContext
Source§fn default() -> DrawContext
fn default() -> DrawContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DrawContext
impl !Send for DrawContext
impl !Sync for DrawContext
impl !UnwindSafe for DrawContext
impl Freeze for DrawContext
impl Unpin for DrawContext
impl UnsafeUnpin for DrawContext
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
Mutably borrows from an owned value. Read more