pub trait Surface {
// Required methods
fn resize(&mut self, size: PhysicalSize);
fn size(&self) -> PhysicalSize;
fn present(&mut self, pixmap: &Pixmap, damage: &[Rect]);
}Expand description
A presentable destination owned by the platform layer (a window’s drawable, a canvas, a layer-backed view, …).
This trait is the GPU-readiness seam: the software backend presents a
Pixmap by blitting; a future GPU backend can implement the same trait
by uploading or compositing directly. damage lists the regions (in
physical pixels) that actually changed since the last present — an empty
slice means “assume everything changed.”
Required Methods§
Sourcefn resize(&mut self, size: PhysicalSize)
fn resize(&mut self, size: PhysicalSize)
Resize the backing store to size physical pixels.
Sourcefn size(&self) -> PhysicalSize
fn size(&self) -> PhysicalSize
The current backing-store size in physical pixels.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".