Skip to main content

Renderer

Struct Renderer 

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

Unified multi-mode rendering facade orchestrating Auto, Software, Hardware, and Hybrid execution.

Implementations§

Source§

impl Renderer

Multi-mode pipeline construction, live mode switching, and frame rendering for Renderer.

Source

pub fn new( platform: PlatformKind, capabilities: PlatformCapabilities, width: u32, height: u32, config: RenderConfig, ) -> Self

Creates a Renderer resolving the optimal backend for platform and config.

§Arguments
  • PlatformKind - Active execution platform.
  • PlatformCapabilities - Hardware capabilities reported by the platform backend.
  • u32 - Initial physical width.
  • u32 - Initial physical height.
  • RenderConfig - Requested rendering configuration.
§Returns
  • Self - Initialized multi-mode renderer facade.
Source

pub fn resolve_mode_and_backend( platform: PlatformKind, capabilities: PlatformCapabilities, config: RenderConfig, ) -> (RenderMode, GraphicsBackend)

Resolves (RenderMode, GraphicsBackend) deterministically from platform capabilities and user preference.

§Arguments
  • PlatformKind - Target platform.
  • PlatformCapabilities - Hardware support flags.
  • RenderConfig - User configuration.
§Returns
  • (RenderMode, GraphicsBackend) - Concrete resolved mode and backend.
Source

pub fn switch_mode( &mut self, platform: PlatformKind, capabilities: PlatformCapabilities, mode: RenderMode, )

Dynamically switches the active rendering mode at runtime without rebuilding the scene tree.

§Arguments
  • &Self - Mutable renderer.
  • PlatformKind - Active platform kind.
  • PlatformCapabilities - Platform hardware capabilities.
  • RenderMode - Target render mode.
Source

pub fn render_frame( &mut self, tree: &SceneTree, viewport: Size, scale_factor: f32, clear_color: Color, layout_stats: LayoutStats, damage: DamageRegion, ) -> Result<FrameStats, PlatformError>

Compiles tree into a DisplayList, executes the active render backend, and returns FrameStats.

§Arguments
  • &Self - Mutable renderer.
  • &SceneTree - Laid-out scene tree.
  • Size - Logical viewport dimensions.
  • f32 - Active DPI scale factor.
  • Color - Surface clear color.
  • LayoutStats - Telemetry from the layout pass.
  • DamageRegion - Damaged screen region.
§Returns
  • Result<FrameStats, PlatformError> - Frame performance and pixel-hash telemetry.
Source

pub fn render_with( &mut self, tree: &SceneTree, params: &FrameRenderParams, ) -> Result<FrameStats, PlatformError>

Renders tree using a compact FrameRenderParams descriptor and returns FrameStats.

§Arguments
  • &Self - Mutable renderer.
  • &SceneTree - Laid-out scene tree.
  • &FrameRenderParams - Viewport, DPI, clear color, layout stats, and damage bundle.
§Returns
  • Result<FrameStats, PlatformError> - Frame performance and pixel-hash telemetry.
Source

pub fn record_skipped_frame(&mut self) -> FrameStats

Advances the frame counter for an undamaged idle frame without rasterizing or hashing pixels.

§Arguments
  • &Self - Mutable renderer.
§Returns
  • FrameStats - Lightweight telemetry preserving the last rendered frame_hash with zero shaded pixels.
Source

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

Returns a reference to the latest CPU-accessible Framebuffer for software/hybrid/readback presentation.

§Arguments
  • &Self - Renderer reference.
§Returns
  • Option<&Framebuffer> - Active RGBA8 framebuffer if available in host memory.
Source§

impl Renderer

Source

pub fn get_config(&self) -> RenderConfig

Source

pub fn get_mut_config(&mut self) -> &mut RenderConfig

Source

pub fn set_config(&mut self, val: RenderConfig) -> &mut Self

Source

pub fn get_active_mode(&self) -> RenderMode

Source

pub fn get_mut_active_mode(&mut self) -> &mut RenderMode

Source

pub fn set_active_mode(&mut self, val: RenderMode) -> &mut Self

Source

pub fn get_active_backend(&self) -> GraphicsBackend

Source

pub fn get_mut_active_backend(&mut self) -> &mut GraphicsBackend

Source

pub fn set_active_backend(&mut self, val: GraphicsBackend) -> &mut Self

Source

pub fn get_software(&self) -> &SoftwareRenderer

Source

pub fn get_mut_software(&mut self) -> &mut SoftwareRenderer

Source

pub fn set_software(&mut self, val: SoftwareRenderer) -> &mut Self

Source

pub fn get_hardware(&self) -> &HardwareRenderer

Source

pub fn get_mut_hardware(&mut self) -> &mut HardwareRenderer

Source

pub fn set_hardware(&mut self, val: HardwareRenderer) -> &mut Self

Source

pub fn get_hybrid(&self) -> &HybridRenderer

Source

pub fn get_mut_hybrid(&mut self) -> &mut HybridRenderer

Source

pub fn set_hybrid(&mut self, val: HybridRenderer) -> &mut Self

Source

pub fn get_display_list(&self) -> &DisplayList

Source

pub fn get_mut_display_list(&mut self) -> &mut DisplayList

Source

pub fn set_display_list(&mut self, val: DisplayList) -> &mut Self

Source

pub fn get_frame_index(&self) -> u64

Source

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

Source

pub fn set_frame_index(&mut self, val: u64) -> &mut Self

Source

pub fn get_compute_pixel_hash(&self) -> bool

Source

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

Source

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

Source

pub fn get_last_stats(&self) -> FrameStats

Source

pub fn get_mut_last_stats(&mut self) -> &mut FrameStats

Source

pub fn set_last_stats(&mut self, val: FrameStats) -> &mut Self

Trait Implementations§

Source§

impl Debug for Renderer

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, 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.