Skip to main content

Module linear

Module linear 

Source
Expand description

Linear gradients

Specification: https://drafts.csswg.org/css-images-4/#linear-gradients

Linear gradients are rendered via cached render tasks and composited with the image brush.

Structs§

LinearGradient
LinearGradientKey
Identifying key for a linear gradient.
LinearGradientTemplate

Functions§

decompose_axis_aligned_gradient
Decompose an axis-aligned linear gradient into a sequence of two-stop segments that tile end-to-end across prim_rect. Each callback invocation is one segment, ready to be rendered as its own quad via the fast-path gradient shader. Run at frame-build (against the snapped prim_rect) so adjacent segments share a snapped boundary and tile without phase drift.
linear_gradient_decomposes
Whether a linear gradient is eligible for the fast-path two-stop-per-segment decomposition at prepare time. Inputs are the values produced by optimize_linear_gradient (i.e. already simplified and clip-adjusted).
optimize_linear_gradient
Perform a few optimizations to the gradient that are relevant to scene building.

Type Aliases§

LinearGradientDataHandle