Expand description
Coverage of a path: per pixel, the average winding number over the pixel’s area, mapped by the fill rule, in 16 by 16 pixel tiles.
Lines are accumulated only in the columns an edge touches, one strip of
tile rows at a time (rasterize); a tile no edge reaches takes the
winding of the run it lies in, without per-pixel work, and is Full
or Empty. The prefix sums add the same non-zero contributions in the
same order as accumulating every pixel would (dense::rasterize_dense,
kept as the reference), so both give the same bytes.
Everything is scalar code in a fixed order: f64 geometry, f32
accumulation, no fused multiply-add. Coverage is the same bytes on every
target.
Modules§
- dense
- The reference rasterizer: every pixel of the clip accumulated and summed.
super::rasterizemust give its bytes; tests and the fuzz target hold it to that.
Structs§
- Coverage
Cache - Coverage by key, least recently used first out, within a byte budget.
- Raster
Scratch - Buffers reused from one rasterization to the next.
- Tile
Coverage - A path’s coverage over a rectangle of whole tiles.
Enums§
- Tile
State - What one tile of coverage holds.
Constants§
- TILE
- Tile edge, in pixels.
- TILE_
BYTES - Bytes of one tile’s coverage.
Functions§
- coverage_
key - The key of
path’s coverage underruleinclip: its bits, so only the same path in the same place shares it. - flattened
- The flattened lines
rasterizeaccumulates forpathinclip, relative to the tile-aligned clip’s corner. - rasterize
- The coverage of
pathunderrulewithinclip(device pixels, grown to whole tiles): per pixel, the average winding number over its area, mapped by the rule. Nonzero ismin(|w|, 1); even-odd a triangle wave of period 2 in|w|. Only pixels where three or more windings cross within the pixel are approximate. - tile_
aligned clipgrown outward to whole tiles.- winding_
at - The winding number of
patharoundpoint, from its flattened lines: what a fill rule decides inside from, for hit tests.