vizia::vg::surfaces

Function raster_n32_premul

pub fn raster_n32_premul(size: impl Into<ISize>) -> Option<RCHandle<SkSurface>>
Expand description

Allocates raster Surface. crate::Canvas returned by Surface draws directly into pixels. Allocates and zeroes pixel memory. Pixel memory size is height times width times four. Pixel memory is deleted when Surface is deleted.

Internally, sets ImageInfo to width, height, native color type, and crate::AlphaType::Premul.

Surface is returned if width and height are greater than zero.

Use to create Surface that matches crate::PMColor, the native pixel arrangement on the platform. Surface drawn to output device skips converting its pixel format.

  • width - pixel column count; must be greater than zero
  • height - pixel row count; must be greater than zero
  • surface_props - LCD striping orientation and setting for device independent fonts; may be None

Returns: Surface if all parameters are valid; otherwise, None