Skip to main content

SoftwareRenderer

Struct SoftwareRenderer 

Source
pub struct SoftwareRenderer { /* private fields */ }
Expand description

High-performance CPU tile and analytical-SDF software rasterizer with zero GPU dependencies.

Implementations§

Source§

impl SoftwareRenderer

Multi-core lossless analytical-SDF and tile-band software rasterizer methods for SoftwareRenderer.

Source

pub fn with_config(width: u32, height: u32, config: RenderConfig) -> Self

Creates a software renderer configured for width x height physical pixels.

§Arguments
  • u32 - Physical width.
  • u32 - Physical height.
  • RenderConfig - Rendering configuration.
§Returns
  • Self - Ready-to-draw software renderer.
Source

pub fn with_font_provider( width: u32, height: u32, config: RenderConfig, font_provider: NativeSystemFont, ) -> Self

Creates a software renderer configured with an explicit NativeSystemFont provider.

§Arguments
  • u32 - Physical width.
  • u32 - Physical height.
  • RenderConfig - Rendering configuration.
  • NativeSystemFont - Native OS or deterministic font provider.
§Returns
  • Self - Ready-to-draw software renderer.
Source

pub fn get_framebuffer(&self) -> &Framebuffer

Returns a reference to the resident RGBA8 framebuffer, or a zero-sized empty sentinel when unallocated.

§Arguments
  • &Self - Software renderer reference.
§Returns
  • &Framebuffer - Resident framebuffer or zero-byte empty sentinel.
Source

pub fn framebuffer_opt(&self) -> Option<&Framebuffer>

Returns the resident RGBA8 framebuffer if allocated, or None when GPU direct-draw skips CPU framebuffer allocation.

§Arguments
  • &Self - Software renderer reference.
§Returns
  • Option<&Framebuffer> - Resident framebuffer reference, if present.
Source

pub fn allocated_framebuffer_bytes(&self) -> usize

Returns total allocated CPU framebuffer bytes currently held by this software renderer (0 when unallocated).

§Arguments
  • &Self - Software renderer reference.
§Returns
  • usize - Allocated CPU RGBA8 framebuffer byte count.
Source

pub fn release_framebuffer(&mut self)

Releases the resident CPU RGBA8 framebuffer and cached portal backdrop bytes to reclaim host RAM in GPU direct-draw mode.

§Arguments
  • &Self - Mutable software renderer.
Source

pub fn set_font_provider( &mut self, font_provider: NativeSystemFont, ) -> &mut Self

Replaces the active native/deterministic font provider and invalidates cached positioned glyph runs.

§Arguments
  • &Self - Mutable software renderer.
  • NativeSystemFont - Replacement font provider.
§Returns
  • &mut Self - Mutable renderer for call chaining.
Source

pub fn set_high_frequency_active(&mut self, active: bool)

Updates adaptive worker-pool hybrid spin mode (true = active animation/scroll ~3072 spins, false = immediate 0-spin park).

§Arguments
  • &Self - Mutable software renderer.
  • bool - Whether high-frequency animation or scrolling is currently active.
Source

pub fn blur_scratch_capacity(&self) -> usize

Returns the current persistent horizontal scratch buffer capacity (in RGBA pixels) retained for separable BackdropBlur.

§Arguments
  • &Self - Software renderer reference.
§Returns
  • usize - Allocated scratch capacity in RGBA pixels.
Source

pub fn positioned_glyph_run_cache_stats(&self) -> (u64, u64, usize)

Returns cumulative PositionedGlyphRunCache telemetry (hits, misses, cached_entries).

§Arguments
  • &Self - Software renderer reference.
§Returns
  • (u64, u64, usize) - Tuple (cache_hits, cache_misses, entry_count).
Source

pub fn set_adaptive_parallel_threshold(&mut self, min_pixels: Option<usize>)

Configures an explicit pixel-area threshold for serial-vs-parallel band dispatch (None re-enables adaptive tuning).

§Arguments
  • &Self - Mutable software renderer.
  • Option<usize> - Explicit minimum damaged pixel area before waking band workers, or None for automatic adaptation.
Source

pub fn adaptive_parallel_threshold(&self) -> usize

Returns the currently active pixel-area threshold separating serial execution from parallel band dispatch.

§Arguments
  • &Self - Software renderer reference.
§Returns
  • usize - Active minimum damaged pixel area required before waking worker threads.
Source

pub fn render( &mut self, display_list: &DisplayList, damage: DamageRegion, ) -> (usize, usize)

Rasterizes display_list into the internal Framebuffer clipped to damage using multi-core parallel horizontal bands and dirty-rect scoped portal backdrop caching.

§Arguments
  • &Self - Mutable software renderer.
  • &DisplayList - Backend-agnostic draw command stream.
  • DamageRegion - Optional dirty damage region for partial rasterization.
§Returns
  • (usize, usize) - Tuple of (tiles_updated, pixels_shaded).
Source

pub fn text_layout_cache_stats(&self) -> (u64, u64, u64, usize)

Returns cumulative TextLayoutCache telemetry (hits, misses, evictions, resident_bytes).

§Arguments
  • &Self - Software renderer reference.
§Returns
  • (u64, u64, u64, usize) - Tuple (cache_hits, cache_misses, evictions, resident_bytes).
Source§

impl SoftwareRenderer

Source

pub fn get_glyph_atlas(&self) -> &GlyphAtlas

Source

pub fn get_mut_glyph_atlas(&mut self) -> &mut GlyphAtlas

Source

pub fn set_glyph_atlas(&mut self, val: GlyphAtlas) -> &mut Self

Source

pub fn get_font_provider(&self) -> &NativeSystemFont

Source

pub fn get_mut_font_provider(&mut self) -> &mut NativeSystemFont

Source

pub fn get_measurer(&self) -> DeterministicTextMeasurer

Source

pub fn get_mut_measurer(&mut self) -> &mut DeterministicTextMeasurer

Source

pub fn set_measurer(&mut self, val: DeterministicTextMeasurer) -> &mut Self

Source

pub fn get_antialiasing(&self) -> AntialiasingMode

Source

pub fn get_mut_antialiasing(&mut self) -> &mut AntialiasingMode

Source

pub fn set_antialiasing(&mut self, val: AntialiasingMode) -> &mut Self

Source

pub fn get_tile_size(&self) -> u32

Source

pub fn get_mut_tile_size(&mut self) -> &mut u32

Source

pub fn set_tile_size(&mut self, val: u32) -> &mut Self

Source

pub fn get_mut_base_cache_width(&mut self) -> &mut u32

Source

pub fn get_mut_base_cache_height(&mut self) -> &mut u32

Source

pub fn get_mut_base_cache_hash(&mut self) -> &mut u64

Source

pub fn get_mut_prev_base_hash(&mut self) -> &mut u64

Source

pub fn get_mut_prev_portal_bounds(&mut self) -> &mut Option<Rect>

Source

pub fn get_mut_prev_portal_scrim(&mut self) -> &mut Option<Color>

Source

pub fn get_mut_prepped_bounds(&mut self) -> &mut Option<Rect>

Source

pub fn get_mut_prepped_fg_bounds(&mut self) -> &mut Option<Rect>

Source

pub fn get_serial_dispatches(&self) -> u64

Source

pub fn get_parallel_dispatches(&self) -> u64

Source

pub fn get_culled_occluded_commands(&self) -> u64

Source

pub fn get_adaptive_parallel_threshold_pixels(&self) -> usize

Source

pub fn get_adaptive_threshold_override(&self) -> usize

Source

pub fn get_last_serial_us(&self) -> u64

Source

pub fn get_last_parallel_us(&self) -> u64

Source

pub fn get_rendered_frames(&self) -> u64

Source

pub fn get_telemetry_enabled(&self) -> bool

Source

pub fn get_mut_telemetry_enabled(&mut self) -> &mut bool

Source

pub fn set_telemetry_enabled(&mut self, val: bool) -> &mut Self

Source

pub fn get_high_frequency_active(&self) -> bool

Source

pub fn get_mut_high_frequency_active(&mut self) -> &mut bool

Trait Implementations§

Source§

impl Clone for SoftwareRenderer

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SoftwareRenderer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SoftwareRenderer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for SoftwareRenderer

§

impl Freeze for SoftwareRenderer
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<u64>: Freeze, PhantomData<(GlyphKey, RasterizedGlyph)>: Freeze, PhantomData<AsciiGlyphStyleTable>: Freeze, PhantomData<(u64, usize)>: Freeze, PhantomData<TextLayoutSlot>: Freeze, PhantomData<TextLayoutResult>: Freeze, PhantomData<(u64, u32)>: Freeze, PhantomData<usize>: Freeze, PhantomData<PositionedGlyphRunSlot>: Freeze, PhantomData<PositionedGlyph>: Freeze, PhantomData<CachedPositionedGlyphRun>: Freeze, PhantomData<(u64, u32, u32)>: Freeze, PhantomData<bool>: Freeze, PhantomData<[u8; 4]>: Freeze, PhantomData<PreppedCommand>: Freeze, PhantomData<(usize, usize)>: Freeze, PhantomData<Rect>: Freeze, PhantomData<Option<RoundedClipMask>>: Freeze, PhantomData<RoundedClipMask>: Freeze, PhantomData<(u32, f32, u16, u16)>: Freeze, PhantomData<CachedCornerMask>: Freeze, PhantomData<(u32, u32, Option<usize>)>: Freeze, *const [[u8; 256]; 4] is !null: Freeze, PhantomData<[[u8; 256]; 4]>: Freeze,

§

impl Move for SoftwareRenderer

§

impl RefUnwindSafe for SoftwareRenderer

§

impl Send for SoftwareRenderer
where RawVecInner: Send, BoxRaw<[[u8; 256]; 4]>: Send,

§

impl Sync for SoftwareRenderer
where RawVecInner: Sync, BoxRaw<[[u8; 256]; 4]>: Sync,

§

impl Unpin for SoftwareRenderer
where *const u8 is !null: Unpin, Box<[[u8; 256]; 4]>: Unpin,

§

impl UnsafeUnpin for SoftwareRenderer

§

impl UnwindSafe for SoftwareRenderer
where RawVecInner: UnwindSafe, BoxRaw<[[u8; 256]; 4]>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.