Expand description
Low-level 32-bit pixel primitives.
Canvas is generic over PixelOps, so a kernel build
monomorphises to the SSE2/AVX2 backend and a host test instantiates
ScalarOps. There is no dyn dispatch on the hot path and no
alloc-backed trait object.
Every public drawing call enters PixelOps::guard first. The kernel
adapter returns an FpuGuard that preserves the
caller’s SSE state; the scalar backend returns a zero-sized guard. The
invariant therefore lives in the API instead of in the memory of each
caller, which is where it used to live (each fill_rect opened with
let _fpu = FpuGuard::save(); by convention).
Structs§
- NoGuard
- The default no-op guard, used by
ScalarOps. - Scalar
Ops - Portable scalar backend. This is the reference implementation used by host tests; it is also correct on any architecture.
Traits§
- Pixel
Guard - Marker for the RAII value returned by
PixelOps::guard. - Pixel
Ops - Raw 32-bit pixel operations.
Functions§
- blend_
word - Blend two packed 32-bit words byte by byte.