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 set_direct_gpu_present(&mut self, enabled: bool)
pub fn set_direct_gpu_present(&mut self, enabled: bool)
Enables or disables direct GPU rendering without steady-state CPU RGBA readback mirroring.
§Arguments
&Self- Mutable renderer.bool-truefor GPU direct-draw (zero CPU RGBA mirror);falseto enable software readback mirror.
Sourcepub fn semantics_contract(&self, scale_factor: f32) -> RenderSemanticsContract
pub fn semantics_contract(&self, scale_factor: f32) -> RenderSemanticsContract
Sourcepub fn capture_reference_framebuffer(
&mut self,
damage: DamageRegion,
) -> &Framebuffer
pub fn capture_reference_framebuffer( &mut self, damage: DamageRegion, ) -> &Framebuffer
Captures an on-demand CPU reference framebuffer for pixel-parity verification even while direct GPU draw is enabled.
§Arguments
&Self- Mutable renderer.DamageRegion- Damage region to rasterize into the reference framebuffer.
§Returns
&Framebuffer- Rendered full-fidelity CPU reference RGBA8 framebuffer.
Sourcepub fn apply_fallback_trigger(
&mut self,
trigger: FallbackTrigger,
now_ms: u64,
) -> FallbackAction
pub fn apply_fallback_trigger( &mut self, trigger: FallbackTrigger, now_ms: u64, ) -> FallbackAction
Evaluates trigger through FallbackPolicyEngine and applies strictly non-degrading cache trimming or CPU reference switching.
§Arguments
&Self- Mutable renderer.FallbackTrigger- Runtime pressure, frame overrun, or GPU fault trigger.u64- Monotonic clock timestamp in milliseconds.
§Returns
FallbackAction- Strictly non-degrading action applied.
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_frame_composite_aware(
&mut self,
tree: &SceneTree,
params: &FrameRenderParams,
composite_only: bool,
) -> Result<FrameStats, PlatformError>
pub fn render_frame_composite_aware( &mut self, tree: &SceneTree, params: &FrameRenderParams, composite_only: bool, ) -> Result<FrameStats, PlatformError>
Compiles tree into a DisplayList, honoring composite-only fast paths and non-degrading CPU reference fallback on unsupported GPU effects.
§Arguments
&Self- Mutable renderer.&SceneTree- Laid-out scene tree.&FrameRenderParams- Viewport, DPI, clear color, layout stats, and damage bundle.bool- Whether only composite/scroll properties changed with zero layout or paint mutations.
§Returns
Result<FrameStats, PlatformError>- Frame performance, direct-draw, fallback, 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.