Skip to main content

PathGradientVertex

Struct PathGradientVertex 

Source
#[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: u32

1 = 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: u32

Padding 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

Source§

fn clone(&self) -> PathGradientVertex

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PathGradientVertex

Source§

impl Debug for PathGradientVertex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Pod for PathGradientVertex

Source§

impl Zeroable for PathGradientVertex

Source§

fn zeroed() -> Self

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

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

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> NoUninit for T
where T: Pod,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,