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§
- Linear
Gradient - Linear
Gradient Key - Identifying key for a linear gradient.
- Linear
Gradient Template
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.