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.
impl Renderer
Multi-mode pipeline construction, live mode switching, and frame rendering for Renderer.
Sourcepub fn new(
platform: PlatformKind,
capabilities: PlatformCapabilities,
width: u32,
height: u32,
config: RenderConfig,
) -> Self
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.
Sourcepub fn resolve_mode_and_backend(
platform: PlatformKind,
capabilities: PlatformCapabilities,
config: RenderConfig,
) -> (RenderMode, GraphicsBackend)
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.
Sourcepub fn switch_mode(
&mut self,
platform: PlatformKind,
capabilities: PlatformCapabilities,
mode: RenderMode,
)
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.
Sourcepub fn render_frame(
&mut self,
tree: &SceneTree,
viewport: Size,
scale_factor: f32,
clear_color: Color,
layout_stats: LayoutStats,
damage: DamageRegion,
) -> Result<FrameStats, PlatformError>
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.
Sourcepub fn render_with(
&mut self,
tree: &SceneTree,
params: &FrameRenderParams,
) -> Result<FrameStats, PlatformError>
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.
Sourcepub fn record_skipped_frame(&mut self) -> FrameStats
pub fn record_skipped_frame(&mut self) -> FrameStats
Sourcepub fn framebuffer(&self) -> Option<&Framebuffer>
pub fn framebuffer(&self) -> Option<&Framebuffer>
Source§impl Renderer
impl Renderer
pub fn get_config(&self) -> RenderConfig
pub fn get_mut_config(&mut self) -> &mut RenderConfig
pub fn set_config(&mut self, val: RenderConfig) -> &mut Self
pub fn get_active_mode(&self) -> RenderMode
pub fn get_mut_active_mode(&mut self) -> &mut RenderMode
pub fn set_active_mode(&mut self, val: RenderMode) -> &mut Self
pub fn get_active_backend(&self) -> GraphicsBackend
pub fn get_mut_active_backend(&mut self) -> &mut GraphicsBackend
pub fn set_active_backend(&mut self, val: GraphicsBackend) -> &mut Self
pub fn get_software(&self) -> &SoftwareRenderer
pub fn get_mut_software(&mut self) -> &mut SoftwareRenderer
pub fn set_software(&mut self, val: SoftwareRenderer) -> &mut Self
pub fn get_hardware(&self) -> &HardwareRenderer
pub fn get_mut_hardware(&mut self) -> &mut HardwareRenderer
pub fn set_hardware(&mut self, val: HardwareRenderer) -> &mut Self
pub fn get_hybrid(&self) -> &HybridRenderer
pub fn get_mut_hybrid(&mut self) -> &mut HybridRenderer
pub fn set_hybrid(&mut self, val: HybridRenderer) -> &mut Self
pub fn get_display_list(&self) -> &DisplayList
pub fn get_mut_display_list(&mut self) -> &mut DisplayList
pub fn set_display_list(&mut self, val: DisplayList) -> &mut Self
pub fn get_frame_index(&self) -> u64
pub fn get_mut_frame_index(&mut self) -> &mut u64
pub fn set_frame_index(&mut self, val: u64) -> &mut Self
pub fn get_compute_pixel_hash(&self) -> bool
pub fn get_mut_compute_pixel_hash(&mut self) -> &mut bool
pub fn set_compute_pixel_hash(&mut self, val: bool) -> &mut Self
pub fn get_last_stats(&self) -> FrameStats
pub fn get_mut_last_stats(&mut self) -> &mut FrameStats
pub fn set_last_stats(&mut self, val: FrameStats) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Forget for Renderer
impl Freeze for Renderer
impl Move for Renderer
impl RefUnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
impl UnwindSafe for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more