Skip to main content

Module surface

Module surface 

Expand description

Describes a drawing destination: a Surface manages the pixels or GPU resources that a crate::Canvas draws into.

Enums§

BackendHandleAccess
BackendSurfaceAccess
ContentChangeMode
RescaleGamma
RescaleMode

Type Aliases§

AsyncReadResult
The result from Image::async_rescale_and_read_pixels() or Image::async_rescale_and_read_pixels_yuv420().
Surface
Surface is responsible for managing the pixels that a canvas draws into. The pixels can be allocated either in CPU memory (a raster surface) or on the GPU (a RenderTarget surface). Surface takes care of allocating a Canvas that will draw into the surface. Call Surface::canvas() to use that canvas (but don’t delete it, it is owned by the surface). Surface always has non-zero dimensions. If there is a request for a new surface, and either of the requested dimensions are zero, then None will be returned.