pub struct Paint<'a> {
pub shader: Shader<'a>,
pub blend_mode: BlendMode,
pub anti_alias: bool,
pub colorspace: ColorSpace,
pub force_hq_pipeline: bool,
}Expand description
Controls how a shape should be painted.
Fields§
§shader: Shader<'a>A paint shader.
Default: black color
blend_mode: BlendModePaint blending mode.
Default: SourceOver
anti_alias: boolEnables anti-aliased painting.
Default: true
colorspace: ColorSpaceColorspace for blending.
This enables gamma correction during the blend operation. While skia supports full color-space conversions, we only support a few (simple) cases. Note that any color space other than Linear will force using the high-quality pipeline.
Default: Linear
force_hq_pipeline: boolForces the high quality/precision rendering pipeline.
tiny-skia, just like Skia, has two rendering pipelines:
one uses f32 and another one uses u16. u16 one is usually way faster,
but less precise. Which can lead to slight differences.
By default, tiny-skia will choose the pipeline automatically,
depending on a blending mode and other parameters.
But you can force the high quality one using this flag.
This feature is especially useful during testing.
Unlike high quality pipeline, the low quality one doesn’t support all rendering stages, therefore we cannot force it like hq one.
Default: false