pub enum WebGl2VertexKind {
Solid,
Text,
Gradient,
Image,
}Expand description
How the fragment stage shades one vertex.
The kind travels with the vertex instead of being a uniform, because the chart puts fills, strokes, labels, and images into one buffer and draws them in the order the display list asks for. A per-vertex kind is what makes that possible: the whole frame is one draw call, and the paint order is the order of the triangles.
Variants§
Solid
A flat-coloured triangle: a fill, a stroke, an area strip, or a label background.
The colour is the one the vertex carries.
Text
A glyph quad, read from the glyph atlas.
The atlas holds white glyphs, so only the coverage the texture carries is used and the colour comes from the vertex.
Gradient
A triangle painted with a gradient.
The colour comes from the ramp row the vertex names, and the vertex’s own alpha scales it.
Image
An image quad, read from the image itself.
Unlike a glyph, an image carries its own colour, so the texture is multiplied by the vertex’s colour.
Implementations§
Source§impl WebGl2VertexKind
Inherent implementation of WebGl2VertexKind.
impl WebGl2VertexKind
Inherent implementation of WebGl2VertexKind.