pub struct Canvas<'a> {
pub pixels: &'a mut [u8],
pub width: u32,
pub height: u32,
pub scale: f32,
pub format: PixelFormat,
pub age: &'a mut BufferAge,
}Expand description
A buffer to draw a window into.
Fields§
§pixels: &'a mut [u8]The buffer’s memory: width * height pixels of 4 bytes, row by row.
width: u32The width in pixels: the window’s logical width times scale,
rounded halfway away from zero, as wp_fractional_scale_v1 says.
The window’s edge is drawn at the buffer’s edge either way.
height: u32The height in pixels, likewise.
scale: f32Physical pixels per logical pixel.
format: PixelFormatHow the buffer stores pixels.
age: &'a mut BufferAgeThe frame the buffer last held, updated by the draw.
Auto Trait Implementations§
impl<'a> !UnwindSafe for Canvas<'a>
impl<'a> Forget for Canvas<'a>
impl<'a> Freeze for Canvas<'a>
impl<'a> Move for Canvas<'a>
impl<'a> RefUnwindSafe for Canvas<'a>
impl<'a> Send for Canvas<'a>
impl<'a> Sync for Canvas<'a>
impl<'a> Unpin for Canvas<'a>
impl<'a> UnsafeUnpin for Canvas<'a>
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