euv-core 0.48.1

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Zero-allocation empty framebuffer sentinel returned when `SoftwareRenderer::framebuffer` is `None`.
pub(crate) static EMPTY_FRAMEBUFFER: Framebuffer = Framebuffer {
    width: 0,
    height: 0,
    pixels: Vec::new(),
};

/// Asynchronous initialization state for `BAND_WORKER_POOL` (`0` = uninitialized, `1` = spawning, `2` = ready).
#[cfg(not(target_arch = "wasm32"))]
pub(crate) static BAND_POOL_STATE: AtomicUsize = AtomicUsize::new(BAND_POOL_UNINITIALIZED);

/// Active adaptive worker spin iteration limit mirrored lock-free across `BandWorkerPool` workers (`0` when idle).
#[cfg(not(target_arch = "wasm32"))]
pub(crate) static BAND_ACTIVE_SPIN_LIMIT: AtomicUsize =
    AtomicUsize::new(BAND_WORKER_SPIN_LIMIT_IDLE as usize);

/// Lazily initialized process-wide persistent worker pool warmed asynchronously after Frame 1.
#[cfg(not(target_arch = "wasm32"))]
pub(crate) static BAND_WORKER_POOL: OnceLock<BandWorkerPool> = OnceLock::new();

thread_local! {
    /// Per-thread reusable scratch buffers for rounded-clip corner save/restore eliminating per-band allocations.
    pub(crate) static BAND_CORNER_SCRATCH: RefCell<BandCornerScratch> =
        RefCell::new(BandCornerScratch::default());
    /// Per-thread reusable 1D horizontal shadow strip scratch buffers eliminating per-shadow allocations.
    pub(crate) static BAND_SHADOW_SCRATCH: RefCell<BandShadowScratch> =
        RefCell::new(BandShadowScratch::default());
    /// Per-thread reusable fixed-point horizontal bilinear sampling LUT for `raster_image` and `raster_sprite_region`.
    pub(crate) static BAND_IMAGE_X_LUT: RefCell<Vec<(usize, usize, u32)>> =
        const { RefCell::new(Vec::new()) };
    /// Per-thread reusable vertically-interpolated opaque RGBA8 row buffer (`u32` packed pixels) for fast separable bilinear image blits.
    pub(crate) static BAND_IMAGE_VROW_U32: RefCell<Vec<u32>> =
        const { RefCell::new(Vec::new()) };
    /// Per-thread reusable 4-byte packed horizontal LUT (`(sx0 << 9) | wx`) keeping bilinear X-indices L1-resident.
    pub(crate) static BAND_IMAGE_X_PACKED: RefCell<Vec<u32>> =
        const { RefCell::new(Vec::new()) };
    /// Per-thread reusable row-major RGBA column sum scratch buffer for O(W*H) vertical sliding-window `BackdropBlur`.
    pub(crate) static BAND_BLUR_COL_SCRATCH: RefCell<Vec<[u32; 4]>> =
        const { RefCell::new(Vec::new()) };
    /// Per-thread reusable horizontal blur scratch buffer for clipped single-band `BackdropBlur` fallback.
    pub(crate) static BAND_BLUR_HORIZ_SCRATCH: RefCell<Vec<[u8; 4]>> =
        const { RefCell::new(Vec::new()) };
}