Skip to main content

Module paint_texture

Module paint_texture 

Source
Expand description

The encoded-paint records the fragment shader samples, and the Rgba32Uint texture they are serialized into.

Each record is 16-byte aligned so it starts on a texel boundary; records are written back to back, and a paint’s index into the texture is the texel it starts at. Sizes are part of the shader contract — a record that grew or shrank would shift every paint after it — so each carries a compile-time size assertion.

Structs§

GpuBlurredRoundedRect
An encoded blurred rounded rectangle paint.
GpuEncodedImage
An encoded image paint.
GpuLinearGradient
An encoded linear gradient paint.
GpuRadialGradient
An encoded radial gradient paint.
GpuSweepGradient
An encoded sweep gradient paint.

Enums§

GpuEncodedPaint
One encoded paint of any kind.

Functions§

encoded_paints_texture_descriptor
The descriptor for an encoded-paint texture of width x height texels.
encoded_paints_texture_height
The encoded-paint texture height needed to hold texels records’ worth of texels in a texture resource_texture_dim texels wide.
grow_encoded_paints_texture_height
The height an encoded-paint texture currently current_height tall must be recreated at to hold texels texels, or None when the existing texture already fits.
lower_encoded_paint
Lower one vello_common encoded paint into the record the strip shader samples, or None when the engine cannot resolve it yet.
pack_kind_and_f_is_swapped
Packs a radial gradient’s kind (bits 0-1, 0 radial / 1 strip / 2 focal) and focal-swap flag (bit 2) into one word.
pack_texture_width_and_extend_mode
Packs a gradient texture’s width (bits 0-29) and extend mode (bits 30-31, 0 pad / 1 repeat / 2 reflect) into one word.
unpack_texture_width_and_extend_mode
The texture width and extend mode packed by pack_texture_width_and_extend_mode.