pub enum Phase {
Clip,
Color,
Glyphs,
Image,
Shading,
PathPrep,
Cull,
RectTest,
ZeroScan,
PathXform,
Patches,
}profiling only.Expand description
One phase of the walk’s engine-side work.
The set is closed and each variant names a span of code rather than a function, because the question is where the cost is and several of these are spread over more than one call site.
Variants§
Clip
crate::clip::resolve: a clip stack reduced to the device calls it
becomes, per object. Allocates a Vec<Clip> and, for a non-rectangular
entry, a transformed BezPath.
Color
crate::color::resolve_argb and the transfer function, per object.
Glyphs
crate::text::place_glyphs and its type-3 sibling: the advance
arithmetic, the cache lookups, and the per-glyph PlacedGlyph.
Image
The image path’s geometry, cache key and pixmap production — everything
crate::walk’s image arms do that is not a device call.
Shading
The shading path’s own evaluation, likewise.
PathPrep
crate::paint::draw_path’s decision tree: the two-point test, the
axis-aligned-rectangle test, the zero-area sub-path scan and the stroke
split — everything a path object costs above the device call.
Cull
The per-object cull test in crate::walk::render_object_list:
crate::walk’s object_bbox and the four comparisons against the
list’s object-space clip box.
RectTest
crate::path::path_rect and snap_rect — draw_path’s case 2, the
axis-aligned-rectangle fast path, which runs on every fill-only path
object whether or not it is a rectangle.
ZeroScan
crate::zero_area::scan_into — draw_path’s case 3, which runs on
every fill-only non-glyph path object and on the corpus almost never
finds anything.
PathXform
The geometry draw_path’s ordinary case hands the device: the path
transformed into device space and clamped by
crate::path::hard_clip. One reserved BezPath per fill, per
object — crate::path::transform_hard_clip fuses the transform and
the clamp into a single pass.
Patches
crate::shading::draw_patches — the Coons and tensor mesh half of a
shading, which rasterizes patch by patch through a scratch device
rather than writing a buffer.
It sits beside shading, not inside it: Phase::Shading wraps
draw_to_pixmap, which the mesh kinds never reach. Like PathPrep,
the span covers the device calls it makes.