Skip to main content

HybridRenderer

Struct HybridRenderer 

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

Sparse-effect hybrid renderer compiling GPU-native primitives directly and rasterizing ONLY tight CPU-only effect tiles.

Implementations§

Source§

impl HybridRenderer

Sparse-effect hybrid partitioning, tight-tile CPU rasterization, and GPU batch compositing for HybridRenderer.

Source

pub fn with_backend( gpu_backend: GraphicsBackend, width: u32, height: u32, config: RenderConfig, ) -> Self

Creates a sparse-effect hybrid renderer targeting gpu_backend for direct GPU primitives and tight-tile compositing.

§Arguments
  • GraphicsBackend - GPU backend used for direct primitive batches and sparse-tile compositing.
  • u32 - Initial physical width.
  • u32 - Initial physical height.
  • RenderConfig - Rendering configuration.
§Returns
  • Self - Initialized sparse-effect hybrid renderer.
Source

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

Creates a sparse-effect hybrid renderer targeting gpu_backend with an explicit font provider.

§Arguments
  • GraphicsBackend - GPU backend used for direct primitive batches and sparse-tile compositing.
  • u32 - Initial physical width.
  • u32 - Initial physical height.
  • RenderConfig - Rendering configuration.
  • NativeSystemFont - Font provider used only when sparse CPU effect regions require rasterization.
§Returns
  • Self - Initialized sparse-effect hybrid renderer.
Source

pub fn partition_commands(display_list: &DisplayList) -> HybridCommandPartition

Partitions display_list into GPU-native primitives versus sparse CPU-only effect regions without rasterizing the full frame.

§Arguments
  • &DisplayList - Frame display list to inspect.
§Returns
  • HybridCommandPartition - Partition counts and tight physical bounds of sparse CPU-only effect regions.
Source

pub fn evaluate_last_frame_net_gain( &self, gpu_full_ms: f64, cpu_full_ms: f64, cpu_tile_ms: f64, gpu_composite_ms: f64, ) -> HybridNetGainEstimate

Evaluates whether the sparse CPU-only effect regions from the most recent frame justify Hybrid over pure GPU or pure CPU.

§Arguments
  • &Self - Hybrid renderer reference.
  • f64 - Pure GPU frame time in milliseconds.
  • f64 - Pure CPU frame time in milliseconds.
  • f64 - Sparse CPU tile raster time in milliseconds.
  • f64 - GPU composite + native primitive time in milliseconds.
§Returns
  • HybridNetGainEstimate - Net gain verdict for AdaptiveRenderRouter.
Source

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

Compiles GPU-native primitives directly into GPU batches and rasterizes ONLY sparse CPU-only effect regions into tight tiles.

§Arguments
  • &Self - Mutable hybrid renderer.
  • &DisplayList - Frame display list.
  • DamageRegion - Dirty damage bounds.
§Returns
  • Result<(usize, usize), PlatformError> - Tuple of (batches_submitted, pixels_shaded).
Source§

impl HybridRenderer

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_compositor(&self) -> &RecordingGpuDriver

Source

pub fn get_mut_compositor(&mut self) -> &mut RecordingGpuDriver

Source

pub fn set_compositor(&mut self, val: RecordingGpuDriver) -> &mut Self

Source

pub fn get_last_cpu_effect_regions(&self) -> &Vec<Rect>

Source

pub fn get_mut_last_cpu_effect_regions(&mut self) -> &mut Vec<Rect>

Source

pub fn set_last_cpu_effect_regions(&mut self, val: Vec<Rect>) -> &mut Self

Source

pub fn get_last_gpu_native_commands(&self) -> usize

Source

pub fn get_mut_last_gpu_native_commands(&mut self) -> &mut usize

Source

pub fn set_last_gpu_native_commands(&mut self, val: usize) -> &mut Self

Source

pub fn get_last_cpu_tile_count(&self) -> usize

Source

pub fn get_mut_last_cpu_tile_count(&mut self) -> &mut usize

Source

pub fn set_last_cpu_tile_count(&mut self, val: usize) -> &mut Self

Source

pub fn get_last_cpu_upload_bytes(&self) -> usize

Source

pub fn get_mut_last_cpu_upload_bytes(&mut self) -> &mut usize

Source

pub fn set_last_cpu_upload_bytes(&mut self, val: usize) -> &mut Self

Source

pub fn get_last_cpu_rasterized_pixels(&self) -> usize

Source

pub fn get_mut_last_cpu_rasterized_pixels(&mut self) -> &mut usize

Source

pub fn set_last_cpu_rasterized_pixels(&mut self, val: usize) -> &mut Self

Trait Implementations§

Source§

impl Clone for HybridRenderer

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 HybridRenderer

Source§

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

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

impl Default for HybridRenderer

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Forget for HybridRenderer

§

impl Freeze for HybridRenderer
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 HybridRenderer

§

impl RefUnwindSafe for HybridRenderer

§

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

§

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

§

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

§

impl UnsafeUnpin for HybridRenderer

§

impl UnwindSafe for HybridRenderer
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.