pub struct Paint<'a> {
    pub shader: Shader<'a>,
    pub blend_mode: BlendMode,
    pub anti_alias: bool,
    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: BlendMode

Paint blending mode.

Default: SourceOver

anti_alias: bool

Enables anti-aliased painting.

Default: false

force_hq_pipeline: bool

Forces 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

Implementations

Sets a paint source to a solid color.

Sets a paint source to a solid color.

self.shader = Shader::SolidColor(Color::from_rgba8(50, 127, 150, 200)); shorthand.

Checks that the paint source is a solid color.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.