Function freya_engine::prelude::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 zeroheight
- pixel row count; must be greater than zerosurface_props
- LCD striping orientation and setting for device independent fonts; may beNone
Returns:Surface
if all parameters are valid; otherwise,None