#[repr(C)]pub struct PathGradientVertex {
pub position: [f32; 2],
pub tex_coord: [f32; 2],
pub local_uv: [f32; 2],
pub paint_type: u32,
pub _pad: u32,
pub gradient_geo: [f32; 4],
pub gradient_color0: [f32; 4],
pub gradient_color1: [f32; 4],
pub gradient_color2: [f32; 4],
pub gradient_color3: [f32; 4],
pub gradient_offsets: [f32; 4],
}Expand description
Vertex for the gradient-filled path pipeline (Tier 3 arbitrary paths
filled with a Paint gradient — linear/radial/conic). Solid-filled
paths keep using the lean QuadVertex/quad_pipeline, tinted by a
flat vertex color (see path_quad_verts in renderer.rs); this
vertex type is only built when PathEntry::paint_data is a gradient
variant, and is drawn by the dedicated path_gradient pipeline
(shaders/path_gradient.wgsl).
tex_coord samples the path atlas’s AA coverage mask (alpha
channel only — the atlas always rasterizes opaque white, see
path_atlas::rasterize_path), exactly like QuadVertex’s monochrome-
glyph path. local_uv is the shape-local 0..1 placement used for the
analytic gradient math — same meaning as SdfVertex::local_uv. The
gradient fields mirror SdfVertex’s layout exactly so the shared
encode_paint_data/encode_stops helpers apply unchanged.
Fields§
§position: [f32; 2]§tex_coord: [f32; 2]Atlas UV — samples the path atlas’s AA coverage mask.
local_uv: [f32; 2]Shape-local UV (0..1 across the path’s bounds) — gradient placement.
paint_type: u321 = linear, 2 = radial, 3 = conic. Never 0 (Solid) — solid fills
never build a PathGradientVertex; see path_gradient_quad_verts
in renderer.rs, which branches on PathEntry::paint_data before
choosing this pipeline.
_pad: u32Padding so the struct stride stays a multiple of 8 bytes.
gradient_geo: [f32; 4]Gradient geometry: [start_x, start_y, end_x, end_y] (or
center/radius for radial, center/angle for conic) in shape-local
UV space — see encode_paint_data.
gradient_color0: [f32; 4]Gradient stop 0: [r, g, b, a]
gradient_color1: [f32; 4]Gradient stop 1: [r, g, b, a]
gradient_color2: [f32; 4]Gradient stop 2: [r, g, b, a]
gradient_color3: [f32; 4]Gradient stop 3: [r, g, b, a]
gradient_offsets: [f32; 4]Gradient stop offsets: [offset0, offset1, offset2, offset3]
Trait Implementations§
Source§impl Clone for PathGradientVertex
impl Clone for PathGradientVertex
Source§fn clone(&self) -> PathGradientVertex
fn clone(&self) -> PathGradientVertex
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PathGradientVertex
Source§impl Debug for PathGradientVertex
impl Debug for PathGradientVertex
impl Pod for PathGradientVertex
Auto Trait Implementations§
impl Freeze for PathGradientVertex
impl RefUnwindSafe for PathGradientVertex
impl Send for PathGradientVertex
impl Sync for PathGradientVertex
impl Unpin for PathGradientVertex
impl UnsafeUnpin for PathGradientVertex
impl UnwindSafe for PathGradientVertex
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.